Use the SetWindowPos API:
Put this in a module:
And this in the Form_Load() event:Code:Public Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos" (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 SWP_NOMOVE = &H2 Public Const SWP_NOSIZE = &H1 Public Const HWND_TOPMOST = -1 Public Sub MakeAlwaysOnTop(ByVal hWindow As Long) SetWindowPos hWindow, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE End Sub
Hope this helps.Code:Private Sub Form_Load() MakeAlwaysOnTop Me.hWnd End Sub




Reply With Quote