Common Control Properties WinForms
Common Control Properties WinForms
of Controls in
Windows Forms
(Visual Studio)
A comprehensive guide to common control
properties
1. Name - Identifies the control in code.
2. Text - Displays text on the control.
3. Enabled - Enables or disables the control.
Common 4. Visible - Shows or hides the control.
Properties 5. ForeColor - Sets text color.
(Applicable 6. BackColor - Sets background color.
to Most 7. Font - Defines the text's font style and size.
Controls) 8. Size - Sets the width and height of the control.
9. Location - Defines the position within the form.
10. Anchor - Determines resizing behavior within
the form.
1. Text - Sets the button label.
2. Enabled - Enables/disables interaction.
Button 3. Visible - Shows/hides the button.
Control - 4. BackColor - Changes button background color.
Common 5. ForeColor - Changes text color.
Properties 6. FlatStyle - Defines button appearance.
7. DialogResult - Specifies the result when clicked.
1. Text - The entered/displayed text.
TextBox 2. Multiline - Allows multiple lines.
Control - 3. ReadOnly - Prevents user modification.
Common 4. PasswordChar - Masks input characters.
Properties 5. MaxLength - Sets the max number of characters.
6. ScrollBars - Adds scrollbars if needed.
1. Text - Defines displayed text.
Label Control 2. AutoSize - Adjusts label size automatically.
- Common 3. TextAlign - Aligns text inside the label.
Properties 4. ForeColor - Changes text color.
5. BackColor - Changes background color.
CheckBox 1. Checked - Determines if checked/unchecked.
Control - 2. Text - Displays text beside the checkbox.
Common 3. AutoCheck - Controls auto-toggle behavior.
Properties 4. Appearance - Sets to standard or button-like.
RadioButton 1. Checked - Determines if selected.
Control - 2. Text - Displays the label text.
Common 3. AutoCheck - Controls auto-toggle behavior.
Properties
ComboBox 1. Items - Collection of dropdown options.
Control - 2. SelectedIndex - Index of selected item.
Common 3. SelectedItem - Value of selected item.
Properties 4. DropDownStyle - Defines dropdown type.
ListBox 1. Items - Collection of list items.
Control - 2. SelectionMode - Single/multiple selection.
Common 3. SelectedItem - Currently selected item.
Properties
PictureBox
Control - 1. Image - Displays an image.
Common 2. SizeMode - Defines image scaling behavior.
Properties
Using meaningful names improves code readability
and maintainability.
Follow standard prefixes for controls:
1. btn - Button (e.g., btnSubmit)
2. txt - TextBox (e.g., txtUsername)