using System;

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace StandardApp
{
    public partial class LogonForm : Form
    {
        public LogonForm()
        {
            InitializeComponent();
        }

        private void butOK_Click(object sender, EventArgs e)
        {
            if (txtCheck.Text == "Alex")
            {
                this.DialogResult = DialogResult.OK;
            }
            else
            {
                MessageBox.Show("В доступе отказано. Попробуйте еще раз",
                   "Вход в программу");
            }
        }

        private void butCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }
    }
}