|
|
Title | Let the user name a form to display |
Description | This example shows how to let the user name a form to display in Visual Basic 6. It uses the Forms collection's Add method to make the form and then calls its Show method. |
Keywords | form, display, InputBox, show form |
Categories | Controls, Tips and Tricks |
|
|
Thanks to Muad Darawshee.
When the user clicks the New Form button, the program uses the InputBox method to get the name of the form to load. It adds the name to the Forms collection and uses the new form's Show method.
|
|
Private Sub cmdNewForm_Click()
Dim form_name As String
form_name = InputBox("Form Name")
If Len(form_name) > 0 Then Forms.Add(form_name).Show
End Sub
|
|
|
|
|
|