Solved

Keeping popup window on top of active form

Posted on 2001-06-21
7
141 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
[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
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

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…
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…
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 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…
Suggested Courses
Course of the Month4 days, 5 hours left to enroll

630 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