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
Printable View
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
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.
That said, I'm guessing you actually want the Text of the child, not the Name.CSharp Code:
private void button1_Click(object sender, EventArgs e) { MessageBox.Show(this.ActiveMdiChild.Name); }
Do'h, I didn't even notice that property. ThanksQuote:
Originally Posted by jmcilhinney
duh....nor did I otherwise I wouldn't have asked the question :-).
Thanks jmcilhinney.
U r my code God.