VB Code:
'====================================================
'====This code was written by joijo and macai=======
'====Use this code freely, but please leave the=======
'====comments. And credit would be nice, too. *wink*====
'====================================================
'Declarations
Declare Sub 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)
'Actual Code
Public Sub AlwaysOnTop(F As Form, Enabled As Boolean)
If Enabled Then 'If the programmer wants the form on top.
SetWindowPos F.hwnd, -2, 0, 0, 0, 0, 3
Else 'If the programmer does want the form on top.
SetWindowPos F.hwnd, -1, 0, 0, 0, 0, 3
End If
End Sub
Me and jojo put that together a while back.