Hiding and Showing Forms in C#


When developing a Windows application using C# it is a fairly safe bet to assume that it will consist of multiple forms (otherwise known as windows). It is unlikely, however, that all of those forms will need to be displayed as soon as the application starts up. In fact, it is more likely that most of the forms will remain hidden until the user performs some action that requires a form to be displayed.
In this chapter we will cover the topic of hiding and showing forms when developing applications in C#.


Creating a C# Application Containing Multiple Forms

Before we can look at hiding and showing Forms we first need to create an application in Visual Studio which contains more than one form. Begin by starting Visual Studio and creating a new Windows Form Application project called CSharpShowForm.
Visual Studio will prime the new project with a single form. Click on the Form to select it and, using the Properties panel change the Nameof the form to mainForm. Next we need to add a second form. To do this, click on the Add New Item in the Visual Studio toolbar to invoke the Add New Item window:
Read More: Click Here