I have some checkbox with no text specified. Now whenever I tab down to this checkbox, it does not get highlighted. How to get it highlighted so that user can know that the cursor is there in checkbox.
I have some checkbox with no text specified. Now whenever I tab down to this checkbox, it does not get highlighted. How to get it highlighted so that user can know that the cursor is there in checkbox.
Know the answer? Post it. Somebody with the same question will find it here.
Saurav GurjarRank #3,722 · 397 pointsPosted Nov 29, 2018, 8:17 PM EST
this.activstats.GotFocus += new System.EventHandler(this.checkBox_Highlight); this.activstats.LostFocus += new System.EventHandler(this.checkBox_EndHighlight); this.chknige.GotFocus += new System.EventHandler(this.checkBox_Highlight); this.chknige.LostFocus += new System.EventHandler(this.checkBox_EndHighlight);private void checkBox_Highlight(object sender, EventArgs e) { CheckBox control = (CheckBox)sender; control.FlatStyle = FlatStyle.Flat; control.ForeColor = Color.Red; } private void checkBox_EndHighlight(object sender, EventArgs e) { CheckBox control = (CheckBox)sender; if (!control.Focused) { control.ForeColor = DefaultForeColor; } }