Visual Studio allows you to build your application forms by selecting UI components in the Toolbox pane on the left and dragging them onto the form in the Design view. To make your application easier to work with, you should change the names of your UI components from the standard label1, label2...label37 to something more recognizable.
Add a Button to the View
From the Toolbox pane on the left, select a button and drag it onto the form (Figure 5-3).
Customize the Button
Click the button on your form once, and in the Properties pane under Appearance, change the label in the text field to "Submit," as shown in Figure 5-4. Then, under Design, set the name of the button to "submitButton," as shown in Figure 5-5.
Create a Click Event Handler
Back in the design view, double-click the button you just created. This opens Form1.cs and generates an empty handler in the Form1.cs file (Figure 5-6).
In the handler, type the following line of code: submitButton.Text = "Clicked";
Was this article helpful?