0% found this document useful (0 votes)
9 views11 pages

Common Control Properties WinForms

The document provides a comprehensive guide to common properties of various controls in Windows Forms, including Name, Text, Enabled, and more for controls like Button, TextBox, Label, CheckBox, RadioButton, ComboBox, ListBox, and PictureBox. It also emphasizes the importance of using meaningful names and standard prefixes for controls to enhance code readability and maintainability. Naming conventions include prefixes such as btn for Button and txt for TextBox.

Uploaded by

alieeyraza1601
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)
9 views11 pages

Common Control Properties WinForms

The document provides a comprehensive guide to common properties of various controls in Windows Forms, including Name, Text, Enabled, and more for controls like Button, TextBox, Label, CheckBox, RadioButton, ComboBox, ListBox, and PictureBox. It also emphasizes the importance of using meaningful names and standard prefixes for controls to enhance code readability and maintainability. Naming conventions include prefixes such as btn for Button and txt for TextBox.

Uploaded by

alieeyraza1601
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/ 11

Common Properties

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)

Naming  3. lbl - Label (e.g., lblMessage)

Conventions  4. chk - CheckBox (e.g., chkRememberMe)


 5. rdo - RadioButton (e.g., rdoMale)
for Controls
 6. cmb - ComboBox (e.g., cmbCountry)
 7. lst - ListBox (e.g., lstItems)
 8. pic - PictureBox (e.g., picLogo)
 9. grp - GroupBox (e.g., grpSettings)
 10. pnl - Panel (e.g., pnlMain)

You might also like