Controls and Events
Controls and Events
Controls and Events
Radio Button
PerformClick
1 Generates a Click event for the
control, simulating a click by a user.
Events of Radio Button Control
2.
Text Gets or sets the text for the picture box.
2.
Image Gets or sets the image that is displayed in the control.
3.
•Determines the size of the image to be displayed in the control. This
property takes its value from the PictureBoxSizeMode enumeration,
which has values:
•Normal - the upper left corner of the image is placed at upper left
part of the picture box
SizeMode •StrechImage - allows stretching of the image
•AutoSize - allows resizing the picture box to the size of the image
•CenterImage - allows centering the image in the picture box
•Zoom - allows increasing or decreasing the image size to maintain
the size ratio.
Methods of the PictureBox Control
CancelAsync
1 Cancels an asynchronous image
load.
Load
2 Displays an image in the picture
box
LoadAsync
3
Loads image asynchronously.
ToString
Returns the string that
4
represents the current picture
box.
Events of the Picture Box Control
S.No Event Description
1. Occurs when the control is
Click
clicked.
2. Overrides the Control.Enter
Enter
property.
3. Occurs when the value of the
FontChanged
Font property changes.
4.
Occurs when the value of the
ForeColorChanged
ForeColor property changes.
5.
Occurs when a key is pressed
KeyDown
when the control has focus.
6.
Occurs when a key is pressed
KeyPress
when the control has focus.
7.
Occurs when a key is released
KeyUp
when the control has focus.
Property Description
Gets or sets the background image for the
BackgroundImage
ProgressBar control.
BackgroundImageLayo Gets or sets the layout of the background image
ut of the progress bar.
Gets or sets the maximum value of the range of
Maximum
the control.
Gets or sets the space between the edges of a
Padding
ProgressBar control and its contents.
Gets or sets the current position of the progress
Value
bar.
Gets or sets the time period, in milliseconds, that
MarqueeAnimationSpe
it takes the progress block to scroll across the
ed
progress bar.
Font Gets or sets the font of text in the ProgressBar.
Methods of the ProgressBar Control
Events of the ProgressBar Control
Event Description
Click Occurs when the control is clicked
Occurs when the user presses a key while the control has
KeyDown
focus.
Occurs when the user presses a key while the control has
KeyPress
focus.
Occurs when the user releases a key while the control has
KeyUp
focus.
MouseClick Occurs when the control is clicked by the mouse.
Paint Occurs when the ProgressBar is drawn.
Enter Occurs when focus enters the control.
TextChanged Occurs when the Text property changes.
Leave Occurs when focus leaves the ProgressBar control.
Example
Tree View Control
Font Gets or sets the font of the text displayed by the control.