Best practices for managing multiple winforms?

Hello experts, I created a windows applications with ms visual studio 2008.  I am looking for best practices for handling multiple windows forms.  In my case, the user will click a button that opens a new form, but he/she may need to navigate back to the original form.  In all there will be around 5 forms that a user may need to switch between.  I tried using the hide/show properties as well as creating new instances and using showdialog and me.close.  I dont want to create a new instance of the form when a user needs to go back.  I use the sub main procedure to launch the application

Imports System.Threading.Thread
Friend Class AppMgr

    <STAThread()> _
    Shared Sub Main()
        Dim frm_main As Loading_Form
        frm_main = New Loading_Form

    End Sub
End Class
Who is Participating?
CodeCruiserConnect With a Mentor Commented:
I would suggest using MDI form with tabbed MDI manager which will make your application look like a tabbed browser like Chrome(functionally not visually).
Mike TomlinsonMiddle School Assistant TeacherCommented:
Why are you using sub main?  Set Loading_Form as the "Startup object" in Project --> Properties.

Now, whenever you open the forms, use the DEFAULT INSTANCE without the "New" keyword.

So, instead of this:

    Dim F1 As New Form1

You'd just use the NAME of the Form directly:


Also, you can simple hide the current form, before opening another:


Depending on when you want the app close, you may want to change the "Shutdown mode" in Project --> Properties to "When last form closes".  By default, if you close the form set as the "Startup object" then the whole application closes.
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.

All Courses

From novice to tech pro — start learning today.