Link to home
Start Free TrialLog in
Avatar of spendergrass
spendergrass

asked on

How do I find MDI Active Child from toolbar on MDI Parent in VB.NET Winforms Application?

I am creating a VB.NET Winforms application in VS 2005.  I have an MDI Parent form which includes a menu bar and toolbar.  All of the other forms within the application are opened up as MDI Child forms.  After entering data into the child forms, I would like to be able to click on the Save button on the parent form toolbar, but I can't quite figure out how to find out what the last active child form was.  Any suggestions?
Avatar of rachitkohli
rachitkohli
Flag of India image

I can suggest a logic for your solution :
Active Child Form on a MDI form can be found by ActiveChild property of MDI form.
You can have a Save routine in your all child forms like
Public Sub Save()
'' Save Code here
End Sub

Then on the toolbar button click of MDI you can call is
Me.ActiveChild.Save()

Avatar of spendergrass
spendergrass

ASKER

That is exactly how I thought it should work; however, I can not see the Save method from Me.ActiveChild.  I double-checked and it is Public.  Any other ideas?
ASKER CERTIFIED SOLUTION
Avatar of rachitkohli
rachitkohli
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That works - thank you so much for your help!

Sarah