I want to disable a Form
from being activated. To do that I use this:
private const int WS_EX_NOACTIVATE = 0x08000000;
protected override CreateParams CreateParams
{
get
{
CreateParams createParams = base.CreateParams;
createParams.ExStyle = WS_EX_NOACTIVATE;
return createParams;
}
}
This is fine for the main activity of my program because I can still click on the buttons and the Form
won't activate. Whatever program is in the foreground stays there.
The problem is at the beginning of my program I need to input some text with the keyboard and for that the Form
must be active or else the text will go to the program in the foreground.
I know where and when I want to enable/disable the Form
ability to be activated, I just don't know how.
EDIT: And when it's not able to be active anymore I still want the buttons of the form to be clickable. With the code here it works like that. The real problem is at the beginning when I want to input some text.