How to create a form with a modal child form
This tip is about defining a form in a macro project which then calls and display a modal child form.
The main steps are:
- Add the parent form to your project using "Add New Form" in the Project Explorer panel of the Scripting Workbench.
- Add the child form the same way, change its property "Show In Ribbon" to False.
- Create a button on the parent form and double-click on it to define its code.
- Enter the code below.
Private Sub button1_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles button1.Click Dim child As New ChildForm child.Form.ShowDialog(MyForm) End Sub