Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2008-06-26
2
Medium Priority
?
536 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 Comments
 
LVL 27

Accepted Solution

by:
planocz earned 2000 total points
ID: 21878267
this might help in finding the child form....

  Private Function CheckActive(ByVal pChildName As String) As Boolean
        '//////////////////////////////////////////////
        '//  Check to see if the form
        '//  is already open for viewing
        '//////////////////////////////////////////////
        For Each childForm As Form In Me.MdiChildren
            If TypeName(childForm).ToUpper = pChildName.ToUpper Then
                childForm.Activate()
                Return True
            End If
        Next
        Return False
    End Function
0
 

Author Comment

by:spendergrass
ID: 21977067
Here is what I ended up having to do:

Dim frmChild As Offer
frmChild = CType(Me.ActiveMdiChild, Offer)
frmChild.SaveData()
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

704 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