How do I refer to a launching window in Visual Basic .Net?

This is my problem:

I have a form called frmSelectTitle which has a command button that I am disabling on selecting an item from a dropdown.  Then I launch a second from called frmTitleBill to show details and allow record changes.  After frmTitleBill is closed, I want to reenable the frmSelectTitle command button, but I can't figure out how to refer to the frmSelectTitle in the frmTitleBill.  I don't want to redo the project to change to any other types of form.  Please show code how to do this.  I need this ASAP.
KaporchAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mike TomlinsonHigh School Computer Science, Computer Applications, Digital Design, and Mathematics TeacherCommented:
Do it all from the first form like this:

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Button1.Enabled = False

        Dim f2 As New Form2
        AddHandler f2.Closed, AddressOf Me.f2_Closed
        f2.Show()
    End Sub

    Private Sub f2_Closed(ByVal sender As Object, ByVal e As System.EventArgs)
        Button1.Enabled = True
    End Sub

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
KaporchAuthor Commented:
That would work except the code is calling a separate mod to launch the new form.  I might have to move that code to be within the launching form, if there is no other way to handle this.  If there is another way which involves less movement of code, I'd appreciate seeing how to refer to the first form in the module.
arnjackCommented:
What about passing an instance of the frmSelectTitle to the method that calls frmTitleBill.
You can then manipulate the calling form from within.  

Also make sure the command button is not private.  Normally, friend or protected.
AJ
Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

arnjackCommented:
Better yet you can set the Parent property in the ShowDialog method of the frmTitleBill or via the owner property of frmTitleBill.  Then cast the owner to type frmSelectTitle and then use the instance there to control the command button.
AJ
arnjackCommented:
Sorry the property is call .Owner not Parent.  You can set the Owner property in the ShowDialog method or directly with the Owner property of the frmTitleBill.


ie:
' FILENAME Operations.VB --
Friend Sub ShowTitleBill(oFrm as IWin32Window)
     Dim oTitleBillScreen as frmTitleBill
     ' any code to initialize the titlebill
     oTitleBillScreen.ShowDialog(ofrm)
     
     Dim oParent as frmSelectTitle
     oParent = DirectCast(ofrm, frmSelectTitle)
     Dim oBut as CommandButton ' or substitue for appropriate control
     oBut = ofrm.Button1
     oBut.Enabled = True
End Sub

Just another way of tackling it.
AJ
KaporchAuthor Commented:
The 1st answer is the closest to the way I would handle this, if I could have.  Thanks for everybody's help!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.