コード例 #1
0
        //this procedure will assign the color of its corresponding label
        //when its corresponding control has been focused
        private void SetLabelsColor()
        {
            if (!LabelColorsEventAssigned)
            {
                foreach (JkMasterColumn column in MasterColumns)
                {
                    if (!String.IsNullOrWhiteSpace(column.LabelName) &&
                        !String.IsNullOrWhiteSpace(column.ControlName))
                    {
                        Control label   = splitContainer.Panel2.Controls.Find(column.LabelName, true).First();
                        Control control = splitContainer.Panel2.Controls.Find(column.ControlName, true).First();

                        if (label != null &&
                            control != null)
                        {
                            control.Enter += (obj, e) =>
                            {
                                if (FormState != FormStates.fsView)
                                {
                                    IAppHandler.SetLabelColorOnEnter(label as Label);
                                }
                            };

                            control.Leave += (obj, e) =>
                            {
                                IAppHandler.SetLabelColorOnLeave(label as Label);
                            };
                        }
                    }
                }
                LabelColorsEventAssigned = true;
            }
        }
コード例 #2
0
 private void txtBalance_Leave(object sender, EventArgs e)
 {
     IAppHandler.SetLabelColorOnLeave(lblBalance);
 }
コード例 #3
0
 private void txtPassword_Leave(object sender, EventArgs e)
 {
     IAppHandler.SetLabelColorOnLeave(lblPassword);
 }
コード例 #4
0
 private void txtUsername_Leave(object sender, EventArgs e)
 {
     IAppHandler.SetLabelColorOnLeave(lblUsername);
 }