Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1725
  • Last Modified:

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?
0
spendergrass
Asked:
spendergrass
  • 2
  • 2
1 Solution
 
rachitkohliCommented:
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()

0
 
spendergrassAuthor Commented:
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?
0
 
rachitkohliCommented:
For the same you can call in other way, i havent tried it coding, just trying to write
Ctype(Me.ActiveChild, Object).Save
0
 
spendergrassAuthor Commented:
That works - thank you so much for your help!

Sarah
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now