I've got a winform application (Formname f1). Inside that form is a Panel (p1) with 2 Buttons (b1 and b2).
The Panel is by Default enabled = false and visible = false.
Now when I press enter in the form (keypress Event) I make the Panel visible and enabled.
When I then click on a button (b1) and press enter again (preview_keyodwn Event) I do the following:
f1.ActiveForm.Focus
p1.Enabled = false;
p1.visible = false;
Now though when I press enter the Panel does not come visible again. After checking why I found out that the Focus is STILL on the button instead of the form itself.
Is there any way to set the Focus away from the button onto the form itself when the Panel goes invisible and disabled?