HELOW THERE
I WANT ASK SOMTHING. WHAT SHOULD I DO TO MAKE FORM ALWAYS ON TOP.
TQ
Printable View
HELOW THERE
I WANT ASK SOMTHING. WHAT SHOULD I DO TO MAKE FORM ALWAYS ON TOP.
TQ
Put this in a module
To make the form stay on top, do thisCode:Public 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
Public Const HWND_TOPMOST = -1
Public Const FLAGS = &H2 Or &H1
Sub StayOnTop(Form As Form)
Dim SetWinOnTop As Long
SetWinOnTop = SetWindowPos(Form.hWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
End Sub
Need more help? Ask me :)Code:StayOnTop Form1
[Edited by Jason Foral on 01-07-2001 at 03:26 PM]
Add the following to the Form you want to stay on top.
Code: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 Form_Load()
SetWindowPos hWnd, -1, 0, 0, 0, 0, 3
End Sub