Solved

Makeing a form always on top.

Posted on 1998-10-04
6
147 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
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now