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,669 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
  • 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Edureka is one of the fastest growing and most effective online learning sites.  We are here to help you succeed.

911 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now