focus()

G

Guest

Hi,

I am trying to make my winform always on top of other windows and want it to
be focus once it's on top of the others:

// some codes
SetWindowPos(this.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
this.Focus(); // "this" refers to the form itself
// some more codes

SetWindowPos works fine but "this.focus()" doesn't do anything. Isn't it
supposed to focus the form and I should see that the form on the taskbar is
clicked?

Any idea? Please advice, thanks!
-P
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top