0% found this document useful (0 votes)
2 views6 pages

Lab 04

Uploaded by

Ahmed Al-nasheri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views6 pages

Lab 04

Uploaded by

Ahmed Al-nasheri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Lab 4

Check boxes and Radio buttons

Create the following form:

1. Study the following properties for check boxes:


 Text.
 Checked.
 Check state.

2. Study the following properties for Radio buttons:


 Text.
 Checked.

3. write code to do the following:

1. Activate the 4 checkboxes in the form, so that whenever a checkbox is checked,


the corresponding property is applied, otherwise it becomes false.

2. Activate the 2 radio buttons, so that whenever the "Personal" is checked, the first
panel is shown, and the other is hidden, and whenever the "Education" is checked,
vice versa.
3. Add a button, "Reset", that changes the checkstate property of any chosen
checkbox to "indeterminate".

Exercise 1:

Create the following form, but first add the six radio buttons without the
groupboxes, and check their behavior.

Question: can you choose "Arial" with "Bold" at the same time?

- Now, add the group boxes and check the difference in the radio buttons
behavior.

- Activate the radio buttons so that they change the size, name and style of the
label font.

- Check the behavior of the "Style" radio buttons, can you select "Bold" and
"Italic" at the same time?

- Activate the checkboxes, and note the difference.


Message box and picture box

Build the following form, where:

1. When the user clicks on the button, the following message box shows:

2. If the user clicks on the OK button, a label shows with “you clicked the Ok
button”.
3. If the user clicks on the Cancel button, a label shows with “you clicked the
Cancel button”.
4. Each time the user clicks on the picture box, the image changes.
Mouse Events

Create the following form, where:

Label 2
Label 3

1. While the cursor moves over the image, the coordinates x and y for the
curser position appear on the form.
2. When the user clicks on the image, the coordinates x and y for the curser
position appear on the form.
3. When the cursor enters the text box, the font size increases, and when the
cursor leaves the text box, the font size returns to its default size.
4. The text in label 2 will be changed to up, down or hover according to the
event performed on the mouse.
5. The text in label 3 will be changed to ”left” if the user clicked on the left
mouse button , and to ”right” if the user clicked on the right mouse button.
Keyboard Events

Create the following form, where:

We will study the following Keyboard Events:

KeyEventArgs
Events Properties
Alt
Ctrl
Key Down Shift
Key Up Keycode
KeyData
KeyValue
KeyPressEventArgs
Events Properties
Key Press KeyChar
NumericUpDown, ToolTip, and LinkLabel

Create the following form, where:

Textbox3

Label5

1. The value in the age textbox must be between 18 and 30 (numericupdown).


2. When the user chooses his age, the value will show in label5 too.
3. When the curser hovers over the age textbox, a note (using tooltip control)
shows as shown in the picture.
4. The user can write his age in textbox3, the value will be stored in the
numericupdown.
5. When the user clicks on Philadelphia link, the university website opens.
6. When the user clicks on calculator link, the calculator application opens.
7. When the user clicks on MS word link, the MS word application opens.
8. When the user clicks on Pictures link, the Pictures folder opens.

You might also like