I have a UserControl that can have child controls.
The user control has styles:
this.SetStyle(
ControlStyles.AllPaintingInWmPaint |
ControlStyles.OptimizedDoubleBuffer |
ControlStyles.Selectable |
ControlStyles.SupportsTransparentBackColor |
ControlStyles.UserPaint,
true);
Now, if I click on usercontrol (not a child control), I want the usercontrol to keep focus, but the focus automatically moves to the first child control. The same thing happens if I use the tab key.
i already failed to cancel OnGotFocus.
Any idea?
source
share