Alway On Top method no longer works for me

  • Thread starter Thread starter SamSpade
  • Start date Start date
S

SamSpade

Below is what I did in VB6 to set a form to be on top.

It nolonger works.

Questions:

Is there a reason to expect it to not work because of the new VS?

Is there a reason to expect it to not work in XP?

Is there an approach that does work?

THANKS





Public Shared Sub AlwaysOnTop(ByVal aHwnd As System.IntPtr, ByVal OnTop As
Boolean)

Const HWND_TOPMOST As Integer = -1

Const HWND_NOTOPMOST As Integer = -2

Dim hwndInsertAfter As Integer

hwndInsertAfter = VB.IIf(OnTop, HWND_TOPMOST, HWND_NOTOPMOST)

Win32.User.SetWindowPos(aHwnd, hwndInsertAfter, 0, 0, 0, 0,
Win32.User.SWP_NOMOVE Or Win32.User.SWP_NOSIZE)

End Sub
 
Hi Sam,

To make it understandable for me, is this the same as the property.

me.topmost = true

Cor
 
To make it understandable for me, is this the same as the property.

me.topmost = true

Sure sounds like it!

Thanks for both replies
 
Back
Top