How to Close a Form in VB.NET


Visual Basic.NET (VB.NET) is a computer programming tool from Microsoft. It is primarily used for creating software to run on Microsoft's .NET runtime. One of the principal components of Visual Basic is the form. A form can be thought of as a window on which you can place interactive and non-interactive items, such as text, images, text boxes and scroll boxes.

Things You'll Need

  • Visual Basic editor and compiler, such as Microsoft Visual Studio.

Creating and C losing Forms

  • Open up your usual Visual Basic development environment that contains the forms you want to learn how to close.

  • Type the following code to close the current form from within an event handler in that form:


  • Type the following code to close a different form from an event handler in the current form:


    Substitute the text FormName for the actual name of the form you wish to close.

Tips & Warnings

  • If you are using Visual Studio, typing the form name immediately followed by a period (.) will list many more functions available to manipulate a form.

Related Searches


  • Photo Credit Jupiterimages/ Images
Promoted By Zergnet



You May Also Like

Related Searches

Check It Out

Geek Vs Geek: Robot battles, hoverboard drag race, and more

Is DIY in your DNA? Become part of our maker community.
Submit Your Work!