If you Google "vb mdi sdi" you will find many resources with examples of how to work with multiple forms.
I am guessing your default forms interface in your development environment is SDI (or Single Document Interface). In this mode, the application opens one main form window, and all other form windows open within the first one. Each form within the main form has the main form as a "parent", so you cannot close the parent without closing the "child" windows.
MDI is Multiple Document Interface. Generally in this approach, you start a "Main" procedure which then launches one or more forms as needed. The "child" forms are then children of the application, not children of the first form window opened. Thus, your main procedure can open a startup window, collect some info (like userid/password) and then that window can be closed and other windows opened as needed.
Last Wiki Answer Submitted: April 15, 2010 6:31 pm by Kccrosser3,830 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
When using the SDI interface in VB, you can have one form call another form, and this form call another. From the called form, you can close the calling one as long as it is not the startup form (you can do this even when the calling form is an MDI container if it was not set as parent of the called form, which is not done by default) . If you close the startup form your application will end.
However, you could call your second form, and then hide the first one:
Dim f As New Form2
f2.Show()
Me.Hide()
But, when doing something like this, if the second form is closed there will be no visible forms but the application will continue running, so this is something that needs to be considered.
When using the SDI interface in VB, you can have one form call another form, and this form call another. From the called form, you can close the calling one as long as it is not the startup form (you can do this even when the calling form is an MDI container if it was not set as parent of the called form, which is not done by default) . If you close the startup form your application will end.
However, you could call your second form, and then hide the first one:
Dim f As New Form2 f2.Show() Me.Hide()But, when doing something like this, if the second form is closed there will be no visible forms but the application will continue running, so this is something that needs to be considered.