05 Demonstration PDF
05 Demonstration PDF
Demonstration
Building C# Windows Application in Visual Studio
IDE
Materials:
Instructions:
1. Tell the students that you will demonstrate how to add and use the controls radio button and combo box,
including how to change the style of a control. This session will demonstrate how to create a simple
restaurant reservation application. Encourage them to watch and listen carefully, and ask them from time
to time if they can still follow your instructions.
2. Open the Microsoft Visual Studio IDE and create a New Project. Select the Windows Forms Application,
name the project as ReservationApplication, then click OK.
3. Click Form1 and go to its properties. Change the value of (Name) property to frmReservation and the
value of Text property to Restaurant Reservation.
4. Tell the students that the first thing you will do is to add all the controls needed to create the application. In
the frmReservation, insert the following controls:
a. Two (2) textboxes. Change the value of their (Name) property to txtName and txtContact.
b. ComboBox control. Change its (Name) property value to cmbSize and the value of Text property
to -Select-.
c. Two (2) radio buttons. Change the value of their (Name) property to rbtCash and rbtCreditCard;
and change their Text property values to Cash and Credit card.
d. Button control. Change its (Name) property value to btnReserve and the value of Text property to
Place reservation.
5. Add labels that will label each inserted control. See Figure 1 for the example output.
9. Select btnReserve then go to its Properties. Change the value of its properties into the following:
Property Value
BackColor SteelBlue
FlatStyle Flat
Size 12
Font
Bold True
ForeColor White
10. Click the Start button to run the application and show the output to the class. See Figure 2 for the design
of the application. Click on the combo box then tell the students that it still has no items to select on it. Click
on the radio buttons then tell them that you can only select one (1) option on it.
25. Click the Start button to run and test the application. See Figure 3 for the example output. Then ask the
students if they have any questions.