Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Keeping popup window on top of active form

Posted on 2001-06-21
7
Medium Priority
?
143 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 300 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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 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…
Suggested Courses

704 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