Advertisement
2_2002-2004 VB function enhancement #118660

Always On Top

Keeps Your Form On Top This Is Really Kewl Because You Can Just Use A false attribuite to set it as not on top instead of using 2 functions

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
Public Sub AlwaysOnTop(myfrm As Form, SetOnTop As Boolean)
  If SetOnTop Then
   lFlag = HWND_TOPMOST
  Else
   lFlag = HWND_NOTOPMOST
  End If
  SetWindowPos myfrm.hwnd, lFlag, _
  myfrm.Left / Screen.TwipsPerPixelX, _
  myfrm.Top / Screen.TwipsPerPixelY, _
  myfrm.Width / Screen.TwipsPerPixelX, _
  myfrm.Height / Screen.TwipsPerPixelY, _
  SWP_NOACTIVATE Or SWP_SHOWWINDOW
End Sub
'Well, if your for example in a form called 'Form1' then you'd simply type:
AlwaysOnTop Form1, True
Original Comments (3)
Recovered from Wayback Machine