Link to home
Start Free TrialLog in
Avatar of eeyo
eeyo

asked on

VB.NET Form Modal vs. Non-modal vs. Owner

I have Form1 and Form2 which should be accessible to the user independently.  A button on Form1 will open Form1A (should be modal to Form1 only) and open Form2 (accessible while Form1A is open):
        Form2.Show() 'Should be independent from Form1 and Form2
        Using frm As New Form1A
            frm.Owner = Me
            frm.ShowDialog()
            'When Form1A closed, do something with user entered data
        End Using 

Open in new window


I have tried using a mixture of owner and show vs. showdialog, but if the Form1A is modal, it also blocks access to Form2.  I need for the user to be able access both Form1A and Form2 at the same time.   When open, Form1A should of course prevent access to Form1.  I realize that I could probable add code to Form1A in the FormClosing event, but I also want the code to be cleaner, and Form1A could be opened from various other forms as well.  Any thoughts on how to accomplish this?
ASKER CERTIFIED SOLUTION
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of eeyo
eeyo

ASKER

I was hoping for a way out, but I will have to accept that modal is at the application level.  JamesBurger's suggestion is a reasonable start.