.Net Focused control has box when tabbed to, but not on cnt.focus()
Posted on 2014-04-24
I have several buttons on a form. If I tab to a button, there is a small box around the text. The box will then move with arrows, tabs or any calls to cnt.focus().
If I never tab to any buttons, I will not have the small box and arrows will not cause it to show, cnt.focus() will not cause it to show either.
I am using a flat style for the buttons with everything set to transparent, and the FlatAppearence.BorderSize=0. I am just changing the colors as the mouse enters/leaves the button's area. However with the tab, one can still see which button will be activated by [ENTER]; without the tab, the one cannot see, since all the buttons have the same color after the mouse exit (I do want that).
How do I cause the system to draw that box around the control that shows it has the focus just like the system does when I tab to the control?