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,675 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
API v SOA 8 37
SSIS Start 2 37
.NET: How to pass typed serialize using JavaScriptSerializer ==> Deserialize in C# 6 33
Upgrade code from VS 2010 to VS 2015 7 32
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

740 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