Solved

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

Posted on 2008-06-26
4
1,676 Views
Last Modified: 2013-11-26
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
Comment
Question by:spendergrass
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 14

Expert Comment

by:rachitkohli
ID: 21877656
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
 

Author Comment

by:spendergrass
ID: 21877683
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
 
LVL 14

Accepted Solution

by:
rachitkohli earned 500 total points
ID: 21877823
For the same you can call in other way, i havent tried it coding, just trying to write
Ctype(Me.ActiveChild, Object).Save
0
 

Author Closing Comment

by:spendergrass
ID: 31471111
That works - thank you so much for your help!

Sarah
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB.Net Data Class 1 49
Help with Report Viewer in VS2013 6 34
Variable 'id' is used before it has been assigned a value 29 45
Difference between Highcharts and Mapbox 10 45
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question