예제 #1
0
 private void enableButtons()
 {
     try
     {
         this.Invoke((MethodInvoker) delegate()
         {
             BtnOK.Show();
         });
         this.Invoke((MethodInvoker) delegate()
         {
             btnLogin.Hide();
         });
         this.Invoke((MethodInvoker) delegate()
         {
             txtUser.Enabled = true;
         });
         this.Invoke((MethodInvoker) delegate()
         {
             txtPassword.Enabled = true;
         });
         this.Invoke((MethodInvoker) delegate()
         {
             Refresh();
         });
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
예제 #2
0
        ///<summary>
        ///Parameters:
        ///Title,
        ///Text,
        ///Title Color,
        ///Text Color
        ///</summary>
        public DialogResult Show(string m_title, string m_text, Color?m_title_forecolor = null, Color?m_text_color = null, bool alert = false)
        {
            LabelTitle.Text      = m_title;
            LabelTitle.ForeColor = m_title_forecolor ?? LabelTitle.ForeColor;

            LabelMessage.Text      = m_text;
            LabelMessage.ForeColor = m_text_color ?? LabelMessage.ForeColor;

            if (alert)
            {
                BtnOK.Show();
                BtnYES.Hide();
                BtnNO.Hide();
            }
            else
            {
                BtnOK.Hide();
                BtnYES.Show();
                BtnNO.Show();
            }

            return(ShowDialog());
        }