We will now modify the event procedure for the button to create a modal form. To do so we need to call the ShowDialog() method of the subForm. Modify the Click event procedure of the mainForm button as follows:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
subForm.ShowDialog()
End Sub
Press F5 once again to build and run the application. After pressing the button in the main form to display the sub form you will find that the main form is inactive as long as the sub form is displayed. Until the sub form is dismissed this will remain the case.
Close the running application.
We will now modify the event procedure for the button to create a modal form. To do so we need to call the ShowDialog() method of the subForm. Modify the Click event procedure of the mainForm button as follows:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
subForm.ShowDialog()
End Sub
Press F5 once again to build and run the application. After pressing the button in the main form to display the sub form you will find that the main form is inactive as long as the sub form is displayed. Until the sub form is dismissed this will remain the case.
Close the running application.
We will now modify the event procedure for the button to create a modal form. To do so we need to call the ShowDialog() method of the subForm. Modify the Click event procedure of the mainForm button as follows:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
subForm.ShowDialog()
End Sub
Press F5 once again to build and run the application. After pressing the button in the main form to display the sub form you will find that the main form is inactive as long as the sub form is displayed. Until the sub form is dismissed this will remain the case.
Close the running application.
Djay Jais
It seems to be an incomplete question.
eAnswers Team
Can you please elaborate your question and let us know what do you want to create with the help of coding.
H.P.Dubey
We will now modify the event procedure for the button to create a modal form. To do so we need to call the ShowDialog() method of the subForm. Modify the Click event procedure of the mainForm button as follows:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
subForm.ShowDialog()
End Sub
Press F5 once again to build and run the application. After pressing the button in the main form to display the sub form you will find that the main form is inactive as long as the sub form is displayed. Until the sub form is dismissed this will remain the case.
Close the running application.
Djay Jais
It seems to be an incomplete question.
eAnswers Team
Can you please elaborate your question and let us know what do you want to create with the help of coding.
H.P.Dubey
We will now modify the event procedure for the button to create a modal form. To do so we need to call the ShowDialog() method of the subForm. Modify the Click event procedure of the mainForm button as follows:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
subForm.ShowDialog()
End Sub
Press F5 once again to build and run the application. After pressing the button in the main form to display the sub form you will find that the main form is inactive as long as the sub form is displayed. Until the sub form is dismissed this will remain the case.
Close the running application.
Djay Jais
It seems to be an incomplete question.
eAnswers Team
Can you please elaborate your question and let us know what do you want to create with the help of coding.
H.P.Dubey
We will now modify the event procedure for the button to create a modal form. To do so we need to call the ShowDialog() method of the subForm. Modify the Click event procedure of the mainForm button as follows:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
subForm.ShowDialog()
End Sub
Press F5 once again to build and run the application. After pressing the button in the main form to display the sub form you will find that the main form is inactive as long as the sub form is displayed. Until the sub form is dismissed this will remain the case.
Close the running application.