Show / Hide Form in VB.NET
How to show and hide form in VB.NET?
Show / Hide FormsForm
in Visual Basic.net 2008 are displayed and hidden using two different methods.To display a form the Show()
is used and to hide a form Hide()
method is used.
This method is used to display the form on top of all other windows even if it is loaded or not loaded into the memory.
In the above syntax, the Show
method can also have argument values 0 or 1 for Modeless or Modal forms.
By default this methods modeless or normal forms, but the modal forms more interactive.
This method hides a form object from the screen, still with the object being loaded in the memory.
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click
Private Sub Button2_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button2.Click
In the above example, two forms Form1
are used. An image is added to Form2
the click event of Button1
the form is shown or hidden. Thus you can show or hide the forms.