Solved

Makeing a form always on top.

Posted on 1998-10-04
6
153 Views
Last Modified: 2010-04-30
I want to have a form that is always ontop... like icq or winamp. how do i do this
0
Comment
Question by:hess
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 10 total points
ID: 1438044
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
 

Author Comment

by:hess
ID: 1438045
where do i put this code
0
 

Author Comment

by:hess
ID: 1438046
where do i put this code
0
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
LVL 10

Expert Comment

by:viktornet
ID: 1438047
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
 

Expert Comment

by:janeausten
ID: 1438048
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
 

Author Comment

by:hess
ID: 1438049
got it thanx
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month10 days, 11 hours left to enroll

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question