Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form stay on top

Status
Not open for further replies.

cyprus106

Programmer
Apr 30, 2001
654
I have 2 forms in my program. One form is a set of options, my main form. and the other is a wizard to find certain options. The wizard is much smaller than the main form, and it's set to appear in the center of the mainform. My problem is that when I lick on the wizard, and it appears, then when I click on the main form, the wizard falls behind it. Is there a function to keep the wizard on top only in the program? I do not want Wizard->FormStyle = fsStayOnTop, because I dont want it to stay on top of everything, just the main form. Anyone knnow how to do that?

Thanx alot, Cyprus
 
Have you tried making the forms MDI parent and child? James P. Cottingham

I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that I am now qualified
to do anything with nothing.
 
i can't do that. It's not an MDI application, for one. If I made it MDI, I'd have to do way more work than necessary. Cyprus
 
cyprus,

Can you do it with the SetWindowPos API and the HWND_TOPMOST constant ?

SetWindowPos(this->Handle,HWND_TOPMOST,0,0,0,0,SWP_NOACTIVATE+SWP_SHOWWINDOW+SWP_NOMOVE+SWP_NOSIZE);

HWND_TOPMOST = -1
HWND_NOTOPMOST = -2
SWP_NOSIZE = 1
SWP_NOMOVE = 2
SWP_NOACTIVATE = 16
SWP_SHOWWINDOW = 64
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top