For example, let's see how to add a button to a form.
If you want to display a message when the button is clicked, a piece of code must be added to the button.
Double-click the button to display the code window. It shows the automatically generated code for the whole form application.
The following code will create a pop up window and display a message:
MessageBox.Show("Thanks for clicking the button!");
The completed code should look like
Click Save All.
Let's test the program by clicking Start to run the program!
Congratulations! Here is how it looks:
Repeat the steps to add an exit button to the form. Use the following Button properties: