Solved

forms that stay always on top

Posted on 1998-08-03
2
192 Views
Last Modified: 2010-05-03
How do I create a form that is always on top, even when other applications (e.g. MSWord) have the focus ?
I have tried the "MyForm.Show 0, ParentForm" but this, of course, works only with its parent form.

Any ideas ?
Thanks in advance.
0
Comment
Question by:HiThere
2 Comments
 

Accepted Solution

by:
luvbox earned 50 total points
ID: 1467550
Declare Function SetWindowPos Lib "User" (ByVal hWnd As Integer, ByVal
hWndInsertAfter As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal
cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer) As Integer


Global Const SWP_NOMOVE = 2
Global Const SWP_NOSIZE = 1
Global Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Global Const HWND_TOPMOST = -1
Global Const HWND_NOTOPMOST = -2

'Put global constants in bas module.

'To set the form XXXX to TOPMOST, use the following code:

success% = SetWindowPos (XXXX.hWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
success% <> 0 When Successful

'To reset the form XXXX to NON-TOPMOST, use the following

success% = SetWindowPos (XXXX.hWnd,HWND_NOTOPMOST, 0, 0, 0, 0, FLAGS)
success% <> 0 When Successful




0
 
LVL 1

Author Comment

by:HiThere
ID: 1467551
Many thanks !
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…

821 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