i

ASP.Net A Complete Guide

Visual Studio Forms Designer

One of the most excellent features of the .Net application is creating a great user interface application. That rich UI we can archive by using the form designer. The form designer in the VS contains many controls. It creates the windows application step by step to explore the designer.

Steps:

Open the visual studio then click on New->Project. You will see below the window will appear.

If you click on the project below, windows will appear.

You can see the multiple options available; from that, kindly select the "Webform app" for C# language. Then you can see the below window appear there.

If you can see, then there is a window on the top of that the "form1" has displayed. This is the default name of that form. This we called the form designer.

Below image shows, you can see the "Toolbox" on the window, which has appeared on the extreme right corner. It contains all the tools required to design web pages.

In the below window, you can see that I have expanded the "All Windows form" tool, and it has displayed much control.

In the below image, I have selected the label control by using that I will explain to you how we can use the controls from the toolbox.

Just drag and drop the label control on the UI. I did the same way, and you can see the output below UI.

Just right click on the "label" control-click on the "properties." I have done that in the above image. Let's try to run the application by pressing the F5. See the output in the below window.

In the below window, you can see the full property window. From here, you can assign height, width; you can set the text to the label. Also, you can select the style sheet.

Below are the different ways by using that we can add the control on the form.

We can add control to the UI just by drawing. In this, actually, we can select the control and just place them on the form, then according to our requirement, just we draw the control.

We can add control on UI just by double-clicking on it. We have a disadvantage of this is it has the chance of getting added the multiple control UI.

We can add the control just by dragging and dropping it on UI. This approach I personally like because by using this, you can add control wherever required. Even you can define the outline for the control later as well as per the requirement.