private void txtBalance_Enter(object sender, EventArgs e) { if (FormState != FormStates.fsView) { IAppHandler.SetLabelColorOnEnter(lblBalance); } }
private void txtConfirmPassword_Enter(object sender, EventArgs e) { if (FormState != FormStates.fsView) { IAppHandler.SetLabelColorOnEnter(lblConfirmPassword); } }
//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; } }
private void txtPassword_Enter(object sender, EventArgs e) { IAppHandler.SetLabelColorOnEnter(lblPassword); }
private void txtUsername_Enter(object sender, EventArgs e) { IAppHandler.SetLabelColorOnEnter(lblUsername); }