How can you keep a form on top and/or visible while still being able to work on another form?
Thanks,
Jeff
Printable View
How can you keep a form on top and/or visible while still being able to work on another form?
Thanks,
Jeff
This question is asked every other day. Try searching the forums.
I think this is what you need make a form with a menu item 'mnuTopmost' and try it
VB Code:
Private Const Swp_NoSize As Long = &H1 Private Const Swp_NoMove As Long = &H2 Private Const Hwnd_TopMost As Long = -1 Private Const Hwnd_NoTopMost As Long = -2 Private Declare Function SetWindowPos Lib "USER32" (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 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, Hwnd_TopMost, 0, 0, 0, 0, Swp_NoMove Or Swp_NoSize Else ' Turn off the TopMost attribute. SetWindowPos hWnd, Hwnd_NoTopMost, 0, 0, 0, 0, Swp_NoMove Or Swp_NoSize End If End Sub
Hope it helps