Using Controls On Windows Form Lab 2
Using Controls On Windows Form Lab 2
Objective: To explore the different controls like CheckBox, RadioButton with a GroupBox,
NumericUpDown, DateTimePicker, ComboBox, and ListBox on Windows Forms.
5. Add the following code to get the values from the windows components and display to
the user.
6. Now Employee registration is completed. Next we will be working on form validation to
restrict user from bad inputs.
Task: Create Interest Calculator using NumberUpDown Component.
Code Behind:
decimal principal;
double rate;
int year;
decimal amount;
string output;
principal = Convert.ToDecimal(principalTextBox.Text);
rate = Convert.ToDouble(interestTextBox.Text);
year = Convert.ToInt32(yearUpDown.Value);
Practice Exercise:
Design a student Registration form take student id, student name, gender, email address,
nationality, semester, and department as an input.User appropriate controls in windows form to
take input from the user. On submit button click display the input details in another form.