Exemple #1
0
        private void btn_ok_Click(object sender, EventArgs e)
        {
            this.panel_value.IsActive = false;
            Val = this.txt_value.Text;
            if (string.IsNullOrEmpty(Val) && string.IsNullOrEmpty(label_value.Text))
            {
                this.panel_value.IsActive = true;
                this.txt_value.Focus();
                return;
            }
            if (_before != null)
            {
                btn_ok.Enabled = false;
                btn_ok.State   = true;

                IAsyncResult iresult = _before.BeginInvoke(null, null);
                bool         result  = _before.EndInvoke(iresult);
                btn_ok.State   = false;
                btn_ok.Enabled = true;
                if (result)
                {
                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    this.panel_value.IsActive = true;
                    this.txt_value.Focus();
                }
            }
            else
            {
                this.DialogResult = DialogResult.OK;
            }
        }
Exemple #2
0
        private void btn_ok_Click(object sender, EventArgs e)
        {
            if (_before != null)
            {
                btn_ok.Enabled = false;
                btn_ok.State   = true;

                IAsyncResult iresult = _before.BeginInvoke(null, null);
                bool         result  = _before.EndInvoke(iresult);
                btn_ok.State   = false;
                btn_ok.Enabled = true;
                if (result)
                {
                    this.DialogResult = DialogResult.OK;
                }
            }
            else
            {
                this.DialogResult = DialogResult.OK;
            }
        }