<p>I'm generating and showing a new WinForms window on top of a Main Window. How can I achieve that the original (Main Window) keeps the focus? Setting the focus back after showing the new window does not solve my problem because I need to prevent the Main Window's title bar from flickering. The new window has to stay on top of the Main Window so I have to set topMost=true. However, this makes no difference for the problem I think.</p>

<p>Thank you!</p>

Setting the focus after you show the new form works fine. My taskbar does not flicker.
```
```
private void button1_Click(object sender, EventArgs e)
{
     Form2 f2 = new Form2();
     f2.TopMost = true;
     f2.Show();
     this.Focus();            
}
```
```
Can I ask why you want to set the focus back on the main form because the new form will, by default, draw on top of the main window and you'll have to close or move the new form to view the main window.