70-526 MCTS
Add and configure a Windows Forms control
Controls are objects that are contained within a form. Each type of control has its own set of properties,
methods, and events that make it suitable for a particular purpose. They can be added and configured at both
Design time and Run time, giving a gui a rich set of client usability.
The MSDN references at the bottom of this page give a list of controls you can use on your form.
Control (Refer System.Windows.Forms namespace)
Control Class (MSDN)
The Control class implements very basic functionality required by classes that display information
to the user.
Common control properties
There are several properties that are common to all controls, this is a list of the most commonly used ones.
Anchor - Determines how the control is anchored in a Form or a Container.
BackColor - Determines the background colour of the control.
BackgroundImage - Sets the image be displayed as the background.
CausesValidation - Determines whether the control causes validation to be performed: Validation determines
whether the information users enter into a control is valid.
Cursor - Determines the cursor that is displayed when the mouse pointer is over the control.
Dock - Determines how the control is docked in a Form or a Container.
Enabled - Determines whether the control can respond to user interaction. When this property is set to false
the control appears greyed out.
Font - Determines the font of the text displayed by the control.
ForeColor - Determines the foreground color of the control.
Height - Gets or sets the height of the control.
Location - Gets or sets the coordinates of the upper-left corner of the control relative to the upper-left corner
of its parent Form or Container.
MaximumSize - Gets or sets the maximum size of the control.
MinimumSize - Gets or sets the minimum size of the control.
Name - Gets or sets the name of the control that is used in code. This property can only be changed at design time.
Size - Represents the height and width of the control in pixels.
TabIndex - Gets or sets the tab order of the control within its container.
TabStop - Specifies whether the control can be accessed by the Tab key.
Tag - Gets or sets the object that contains data about the control. This information is stored as a string in the Windows Form designer.
Text - Gets or sets the text associated with this control.
Visible - Determines whether or not the control is visible.
Width - Gets or sets the width of the control.
Exam Sections
MSDN references
Controls to Use on Windows Forms
Windows Forms Controls
Windows Forms Controls by Function
© Publicjoe, 2007
|