4
Answers

Form that reactivates itself

James Kiefer

James Kiefer

15y
4.7k
1
I'm trying to create a form that will reactivate itself when deactivated. So far I have tried these methods:


private void Form1_Deactivate(object sender, EventArgs e)
{
SetForegroundWindow(this.Handle.ToInt32());
Activate();
BringToFront();
textBox1.Focus();
}

private void Form1_Leave(object sender, EventArgs e)
{
SetForegroundWindow(this.Handle.ToInt32());
Activate();
BringToFront();
textBox1.Focus();
}



So far none of this has worked. Suggestions? Also, what code tag should I use? I had to break all of that myself.
Answers (4)