Solved

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

Posted on 2008-06-26
2
520 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 Comments
 
LVL 27

Accepted Solution

by:
planocz earned 500 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
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 …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 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

10 Experts available now in Live!

Get 1:1 Help Now