Retrieve Z-Order position

  • Thread starter Thread starter Roland Wolters
  • Start date Start date
R

Roland Wolters

Hi,

My application shows two seperate forms. I need both forms to be visible.
Form one is kind of a paret form so it has a handle to form2. So when the
user activates form1 a try to do from2.BringToFront but that causes me to
loose focus. Yes I can think of a trick to send focus back to form1 but is
feels....not very elegant.

Is there a way to determine if form2 is already visible (so I don't have to
do anything) and if it is not visible can I change that witout loosing
focus.


Greetigs,

ROland WOlters
 
Try the static property bool Form.ActiveForm
If you want to determine wheather a controls has focus try
myControl.Focused, myControl.ContainsFocus

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu
[noncommercial and no ****ing ads]
 
Hi Roland,

You can do that very easy. Make form1 owner of form2. To do that set
form2.Owner property with the reference to form1. In this case form2 will be
always on top of form1. When make form1 visible it will bring the form2 in
front of it and the owner won't lose the focus.
 
Back
Top