Open Modal Form After MDI Load

I'm using VB.NET.

I have an application with 2 forms.

frmMDI is the main MDI Container for the application and is the Start Up object for the application.
frmSales is a second form.

When the application starts, I want the frmMDI to open and then load and open the frmSales as a Modal
form.  To do this, I have the following code in the Sub New() for frmMDI.

Public Sub New()
       MyBase.New()
       Dim frmS as New frmSales
      frmS.ShowDialog()
End Sub

The problem is that since I load the frmSales as modal in the Sub New() for frmMDI, frmSales loads first.  Then when I close frmSales, frmMDI continues to load.

How can I have frmMDI load completely and then frmSales load as modal?

Thanks in advance.
tfewster949Asked:
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.

Farzad AkbarnejadDeveloperCommented:
Public Sub New()
      MyBase.New()
      frmMDI.Show
      Dim frmS as New frmSales
      frmS.ShowDialog()
End Sub

Startup module for your application must be Sub New()

-FA
0

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
Mike TomlinsonMiddle School Assistant TeacherCommented:
Or like this:

    Private Sub frmMDI_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Show()
        Dim frmS As New frmSales
        frmS.ShowDialog()
    End Sub

~IM
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.