Click to See Complete Forum and Search --> : FORM ALWAYS ON TOP??????????
g.mie
Jan 7th, 2001, 07:43 AM
HELOW THERE
I WANT ASK SOMTHING. WHAT SHOULD I DO TO MAKE FORM ALWAYS ON TOP.
TQ
Put this in a module
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
To make the form stay on top, do this
StayOnTop Form1
Need more help? Ask me :)
[Edited by Jason Foral on 01-07-2001 at 03:26 PM]
Add the following to the Form you want to stay on top.
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
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.