Windows Application - SPLessons

Win App Button Control

Home > Lesson > Chapter 9
SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

Win App Button Control

Windows Application Button Control

Button Control

shape Description

Button Control is one of the most used control. Without button control, it's hard to do anything. Button Control's default event is Click event. Button Control have Name and Text properties. One can also change the appearance of the button using Font, Back Color, and Fore Color Properties.

shape Flow Steps

Follow the below steps to know about the button functionality.
  1. Drag and drop the button control onto the form.
  2. Give the Name and Text Property as required.
  3. Button appearance can also be changed.
  4. See the below figure to know how it looks like.
  5. Double click on the button, then the click event is raised.
  6. Now, write the code as below to display a message after button click. [csharp] private void btnClick_Click(object sender, EventArgs e) { MessageBox.Show("WELCOME TO SPLESSONS TUTORIALS"); }[/csharp]
  7. Press F5 or Start to run the application.
  8. Click on the button, then it shows a message box.
  9. Below figure shows the output.