Solved

Keeping popup window on top of active form

Posted on 2001-06-21
7
137 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 142

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 142

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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 142

Expert Comment

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Updates not working for MS Windows 7 12 154
vb6 connector to mongodb 2 54
vb6 - Transfer from MSHFlexgrid1 to xls issue 8 48
Help me. 3 48
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

863 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

20 Experts available now in Live!

Get 1:1 Help Now