Solved

Keeping popup window on top of active form

Posted on 2001-06-21
7
139 Views
Last Modified: 2010-05-02
I want to keep a popup form in front of the active form while the popup is open.

It is a small window that contains address info that the user may want to see while working on the form.

I hope this is easy...I have tried the setparent api but it doesn't work the way I would like it to...It only allows movement within the form... if it is possible they should be able to move it anywhere on the screen.

Thanks...sorry for low points
0
Comment
Question by:setfocus
  • 3
  • 2
  • 2
7 Comments
 
LVL 3

Expert Comment

by:jrspano
ID: 6214686
this will keep it on top of everything



SetWindowPos form.hwnd, HWND_NOTOPMOST, 0&, 0&, 0&, 0&, SWP_NOACTIVATE Or SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOREDRAW

here are the constants
Private Const HWND_NOTOPMOST = -2
Private Const HWND_TOPMOST = -1
Private Const HWND_TOP = 0
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOZORDER = &H4
Private Const SWP_NOREDRAW = &H8
Private Const SWP_NOACTIVATE = &H10
Private Const SWP_NOOWNERZORDER = &H200

make the form show non modal and use this on it
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 75 total points
ID: 6214687
Yes, simply open your (popup) window like this:

frmPopup.Show vbModeless, frmYourActiveForm

CHeers
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6214694
<grr> when will these "experts" learn that API is not always the first solution ...</grr>
just joking
0
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.

 

Author Comment

by:setfocus
ID: 6214722
I always try to get around API's especially if your one liner works...

I like to keep it simple.

testing..
0
 

Author Comment

by:setfocus
ID: 6214812
Excellent! Exactly what I wanted... and simple
0
 
LVL 3

Expert Comment

by:jrspano
ID: 6214880
cool i didn't know it was that easy!!
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6214900
glad i could help 2 people at the same time!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

820 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