how to check if window is on top, window = hasfocus? - c# form application
Posted on 2008-06-17
i would like to set focus on a text field, when window(form) in on top of all on the desktop.
i have experimented with this ...
private void Form1_Resize(object sender, System.EventArgs e)
if (this.WindowState == FormWindowState.Maximized)
else if (this.WindowState == FormWindowState.Minimized)
if (ActiveForm == this)
but this code only shows ...
it only detects miinimized state, not the returning to maximiz state.
i would like to know how to detect if a form application is on top.
i'm fairly a n oob in this materiaal.