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
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