form stay on top of other forms
form stay on top of other forms
API Declarations
' This statement should be placed in the module.
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
Rate form stay on top of other forms
(1(1 Vote))
' Set some constant values (from WIN32API.TXT).
Const conHwndTopmost = -1
Const conHwndNoTopmost = -2
Const conSwpNoActivate = &H10
Const conSwpShowWindow = &H40
Private Sub mnuTopmost_Click ()
' Add or remove the check mark from the menu.
mnuTopmost.Checked = Not mnuTopmost.Checked
If mnuTopmost.Checked Then
' Turn on the TopMost attribute.
SetWindowPos hWnd, conHwndTopmost, 0, 0, 0, 0,_ conSwpNoActivate Or conSwpShowWindow
Else
' Turn off the TopMost attribute.
SetWindowPos hWnd, conHwndNoTopmost, 0, 0, 0,_ 0, conSwpNoActivate Or conSwpShowWindow
End If
End Sub
form stay on top of other forms Comments
No comments yet — be the first to post one!
Post a Comment