Beispiel #1
0
 private void disableButtons()
 {
     try
     {
         this.Invoke((MethodInvoker) delegate()
         {
             BtnOK.Hide();
         });
         this.Invoke((MethodInvoker) delegate()
         {
             btnLogin.Show();
         });
         this.Invoke((MethodInvoker) delegate()
         {
             txtUser.Enabled = false;
         });
         this.Invoke((MethodInvoker) delegate()
         {
             txtPassword.Enabled = false;
         });
         this.Invoke((MethodInvoker) delegate()
         {
             Refresh();
         });
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Beispiel #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());
        }