Does anyone know how to make a VB form - Always On Top ? (with VB coding, please ...)
Printable View
Does anyone know how to make a VB form - Always On Top ? (with VB coding, please ...)
This should be placed in the module:
code:
--------------------------------------------------------------------------------
Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Const conHwndTopmost = -1
Const conHwndNoTopmost = -2
Const conSwpNoActivate = &H10
Const conSwpShowWindow = &H40
--------------------------------------------------------------------------------
Use this in the event you want to set it topmost:
code:
--------------------------------------------------------------------------------
SetWindowPos hWnd, conHwndTopmost, 0, 0, 0, 0, conSwpNoActivate Or conSwpShowWindow
SetWindowPos hWnd, conHwndNoTopmost, 0, 0, 0, 0, conSwpNoActivate Or conSwpShowWindow
[email protected]
http://smalig.tripod.com