|
-
Jan 7th, 2001, 08:43 AM
#1
Thread Starter
Addicted Member
HELOW THERE
I WANT ASK SOMTHING. WHAT SHOULD I DO TO MAKE FORM ALWAYS ON TOP.
TQ
-
Jan 7th, 2001, 12:14 PM
#2
SetWindow Pos API
Put this in a module
Code:
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
Need more help? Ask me 
[Edited by Jason Foral on 01-07-2001 at 03:26 PM]
-
Jan 7th, 2001, 03:24 PM
#3
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|