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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to keep one form in front of other form

Status
Not open for further replies.

MDA

Technical User
Jan 16, 2001
243
US
Hi all,

I have a main form with a treeview control and a second form that is shown at the user request, it also contains a treeview control.

The user can drag nodes from the the "pop-up" (second) form onto the main forms tree. With both forms open, I want to make sure the "pop-up" (Second) form is not hidden if the user clicks on the main form.

Any ideas on how to do this?

Thanks,
MDA
 
Have you tried setting the TopMost property of your second form to true?



DotNetDoc
M.C.S.D.
---------------------------------------

Tell me and I forget. Show me and I remember. Involve me and I understand.
- Anonymous Chinese Proverb
-----------------------------------
If you can't explain it simply, you don't understand it well enough.
- A. Einstein
 
Thank you.. I knew it would be something simple!

Regards,
MDA
 
You could use owned form for the second form like:

Dim frm As New SecondForm
frm.Owner = Me
frm.Show()

if Owner is closed or minimized, SecondForm is also closed or minimized. Owned forms are also never displayed behind their owner form

/Carsten
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top