|
-
Dec 12th, 2007, 10:01 AM
#1
Thread Starter
Fanatic Member
mdi child on top
I have a mdi parent form and numerous mdi children.
When the user clicks on a button on the parent form i need to be able to find the name of the child form which is currently on top.
Any Ideas my Luverlies :-)
TIA
Last edited by venerable bede; Dec 13th, 2007 at 04:51 AM.
-
Dec 12th, 2007, 01:39 PM
#2
Re: mdi child on top
Well, you could iterate through the MdiChildren property of the parent form to find one currently in focus or you could use the MdiChildActivate event of the parent form to track it yourself.
-
Dec 12th, 2007, 11:58 PM
#3
Re: mdi child on top
CSharp Code:
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show(this.ActiveMdiChild.Name);
}
That said, I'm guessing you actually want the Text of the child, not the Name.
Last edited by jmcilhinney; Dec 13th, 2007 at 12:00 AM.
Reason: Changed VB.NET code to C#
-
Dec 13th, 2007, 12:35 AM
#4
Re: mdi child on top
 Originally Posted by jmcilhinney
CSharp Code:
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show(this.ActiveMdiChild.Name);
}
That said, I'm guessing you actually want the Text of the child, not the Name.
Do'h, I didn't even notice that property. Thanks
-
Dec 13th, 2007, 04:13 AM
#5
Thread Starter
Fanatic Member
Re: mdi child on top
duh....nor did I otherwise I wouldn't have asked the question :-).
Thanks jmcilhinney.
U r my code God.
Last edited by venerable bede; Dec 13th, 2007 at 04:51 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|