0% found this document useful (0 votes)
48 views

CH3 4

This document discusses various controls in Windows forms including RadioButton, CheckBox, GroupBox, and Tab controls. It describes the properties and usage of each control, provides examples of how to add them to a form and write code to handle events. It also discusses using grouping controls like GroupBox to allow selecting multiple radio buttons and using Tab controls to organize groups of controls onto separate tab pages.

Uploaded by

Mikiyas Getasew
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)
48 views

CH3 4

This document discusses various controls in Windows forms including RadioButton, CheckBox, GroupBox, and Tab controls. It describes the properties and usage of each control, provides examples of how to add them to a form and write code to handle events. It also discusses using grouping controls like GroupBox to allow selecting multiple radio buttons and using Tab controls to organize groups of controls onto separate tab pages.

Uploaded by

Mikiyas Getasew
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/ 32

Working with

RadioButton,
CheekBox and
Groupbox Control
controls

Compiled By Abrham Y.
1
RadioButton Control

Compiled By Abrham Y. 2
RadioButton Control

• This control is used to provide selection of


only one option from the given group of
option
• The RadioButton control can display text
an image or both

Compiled By Abrham Y. 3
Adding RadioButton controls to
a window form

Compiled By Abrham Y. 4
Properties of the RadioButton control
Property Description
Text Gets or sets the current text in the RadioButton
Name Gets or sets the current name of RadioButton
Checked True: Radio button is Activated/Selected
True False : Radio button is not Activated/Selected
False(default)
CheckAlign Gets or sets the location of the check box portion of
TopLeft the RadioButton
TopCenter
TopRight
TopLeft
TopCenter
TopRight
TopLeft
TopCenter
TopRight

e.t.c e.t.c Compiled By Abrham Y. 5


Event associated with RadioButton
Event Description
CheckedChanged Is the default event of the radio button
This event will be fired when radio button is
selected or deselected
AutoSizeChanged Occurs when the value of the AutoSize property
changes
Click Occurs when the control is clicked
-------- -----

etc etc

Compiled By Abrham Y. 6
Example 1
Step1:Design and create the user interface

Compiled By Abrham Y. 7
Cont…
Step2: write code
1.The application should respond to this click
event Red, Green, Blue and White Radio
Buttons

Compiled By Abrham Y. 8
CheekBox Control

Compiled By Abrham Y. 9
CheekBox Control

• This control is used to provide selection of


more than one option from the given group
of option
• The CheekBox control can display text, an
image or both

Compiled By Abrham Y. 10
Adding CheekBox controls to a
window form

Compiled By Abrham Y. 11
Properties of the RadioButton control
Property Description
Text Gets or sets the current text in the checkbox
Name Gets or sets the current name of checkbox
Checked True: Radio button is Activated/Selected
True False : Radio button is not Activated/Selected
False(default)
CheckAlign Gets or sets the location of the check box portion of the
TopLeft checkbox
TopCenter
TopRight
TopLeft
TopCenter
TopRight
TopLeft
TopCenter
TopRight

CheckedState Indicate the state of the checkbox


Unchecked(default)
Checked
indeterminate
12
e.t.c e.t.c Compiled By Abrham Y.
Event associated with CheekBox
Event Description
CheckedChanged Is the default event of the radio button
This event will be fired when CheekBox button is
selected or deselected
AutoSizeChanged Occurs when the value of the AutoSize property
changes
Click Occurs when the control is clicked
-------- -----

etc etc

Compiled By Abrham Y. 13
Example 1
Step1:Design and create the user interface

Compiled By Abrham Y. 14
Cont…
Step2: write code
1.The application should respond to Submit
click event by display name and hobbies
selected on text box(label)

Compiled By Abrham Y. 15
Grouping/containers
Controls
Compiled By Abrham Y. 16
Grouping Controls

• If user would like to select more than one


radio button then we use grouping controls
• Types of grouping controls
– Groupbox
– Panel
– SpliteContainer
– Tab control

Compiled By Abrham Y. 17
Groupbox Control

Compiled By Abrham Y. 18
Adding Groupbox controls to a
window form

Compiled By Abrham Y. 19
Reading Assignment

• Properties of the Groupbox control


• Event associated with Groupbox control

Compiled By Abrham Y. 20
Example 1
Step1:Design and create the user interface

Compiled By Abrham Y. 21
Cont…
Step2: write code
1.The application should respond to this click
event Red, Green, Blue and White etc
Radio Buttons

Compiled By Abrham Y. 22
Example 2
Step1:Design and create the user interface

Compiled By Abrham Y. 23
Cont…
Step2: write code
1.The application should respond to this click
event

Compiled By Abrham Y. 24
Example 3
Step1:Design and create the user interface

Compiled By Abrham Y. 25
Cont…
Step2: write code
1.The application should respond to this click
event please order and exit

Compiled By Abrham Y. 26
Tab Control

Compiled By Abrham Y. 27
Tab Control

• This control is used to create required tab


pages so that each tab page can contain
required number of controls to group
together

Compiled By Abrham Y. 28
Adding Tab controls to a
window form

29
Properties of the Tab Control control

Property Description
TabPages Used to set or get the tab pages with in
it the form of collection

etc etc

30
Compiled By Abrham Y.
Example 1
Step1:Design and create the user interface

Compiled By Abrham Y. 31
Cont…
Step2: write code
1.The application should respond to this click
event Back Color and Fore Color tabs

Compiled By Abrham Y. 32

You might also like