Makeing a form always on top.

I want to have a form that is always ontop... like icq or winamp. how do i do this
hessAsked:
Who is Participating?
 
MikeP090797Connect With a Mentor Commented:
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

SetWindowPos frmTools.hwnd, -1, 0, 0, 0, 0, 3
0
 
hessAuthor Commented:
where do i put this code
0
 
hessAuthor Commented:
where do i put this code
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
viktornetCommented:
How about this ???

SetForegroundWindow(Me.hWnd) 'API call...find it in the help file...

Maybe try putting it in a Timer's OnTimer() event...
0
 
janeaustenCommented:
Hess,

put it in your Form_Load, like so

Private Sub Form_Load()
    'sets form to be always on top
    'SetWindowPos hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE
   
End Sub


hope this helps
0
 
hessAuthor Commented:
got it thanx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.