Find which Windows Form is on top
-
Hi, I have some MDI children forms that are laid out (sometimes one on top of the other). At a given time, I need to find out which forms are on top and which forms are hidden behind the forms on top. I Iwas wondering if there's some way to do this. I could not find anything online. Thank you, Ramanan
"One of the Georges," said Psmith, "I forget which, once said that a certain number of hours' sleep a day--I cannot recall for the moment how many--made a man something, which for the time being has slipped my memory."
-
Hi, I have some MDI children forms that are laid out (sometimes one on top of the other). At a given time, I need to find out which forms are on top and which forms are hidden behind the forms on top. I Iwas wondering if there's some way to do this. I could not find anything online. Thank you, Ramanan
"One of the Georges," said Psmith, "I forget which, once said that a certain number of hours' sleep a day--I cannot recall for the moment how many--made a man something, which for the time being has slipped my memory."
Hello Use
MyMDIChildClass.ActiveForm
static property.Regards:rose:
-
Hello Use
MyMDIChildClass.ActiveForm
static property.Regards:rose:
Hi, I can't really use that because I want to also know which inactive forms are on top, and which ones are on the bottom. For instance I can have 8 child forms open in a 2x2 layout with 4 on top and 4 below. I want to know which 4 are on top. Of course, only one of them is active and has focus. But I want to get a list of all 4. Thanks, R
"One of the Georges," said Psmith, "I forget which, once said that a certain number of hours' sleep a day--I cannot recall for the moment how many--made a man something, which for the time being has slipped my memory."
-
Hi, I can't really use that because I want to also know which inactive forms are on top, and which ones are on the bottom. For instance I can have 8 child forms open in a 2x2 layout with 4 on top and 4 below. I want to know which 4 are on top. Of course, only one of them is active and has focus. But I want to get a list of all 4. Thanks, R
"One of the Georges," said Psmith, "I forget which, once said that a certain number of hours' sleep a day--I cannot recall for the moment how many--made a man something, which for the time being has slipped my memory."
I don't know if there is a function or a property to get the Z-Order of a form!! You can BringToFront() or SendToBack() but it isn't what you want!! All I can think of is to track your Z-Order manually. When a form is clicked and activated it should update its Z-Order in a static list in the MDIChild class sending all other forms behind. This way you will check the list for the order of forms.
Regards:rose:
-
I don't know if there is a function or a property to get the Z-Order of a form!! You can BringToFront() or SendToBack() but it isn't what you want!! All I can think of is to track your Z-Order manually. When a form is clicked and activated it should update its Z-Order in a static list in the MDIChild class sending all other forms behind. This way you will check the list for the order of forms.
Regards:rose:
-
i had implemented the same thing using a arraylist WHen a form is opened or clicked it is added to the ArrayList, so u get the forms in the reverse order of the Arraylist. Hope that works for you.
Thanks & Regards, Pramod "Everyone is a genius at least once a year"