How to Design a Windows Forms Application - How to set properties
(Page 5 of 5 )
After you have placed controls on a form, you need to set each control’s properties. These are the values that determine how the controls will look and work when the form is displayed. In addition, you need to set some of the properties for the form itself.
To set the properties of a form or control, you work with the Properties window as shown in figure 2-5. To display the properties for a specific control, click on it in the Form Designer window to select the control. To display the properties for the form, click the form’s title bar or any blank area of the form.
In the Properties window, you can select a property by clicking it. When you do, a brief description of that property is given at the bottom of the Properties window. (If you can’t see this description, you can drag the bottom line of the window upward.) Then, to change a property setting, you change the entry to the right of the property name by typing a new value or choosing a new value from a drop-down list.
To display properties alphabetically or by category, you can click the appropriate button at the top of the Properties window. At first, you may want to display the properties by category so you have an idea of what the different properties do. Once you become more familiar with the properties, though, you may be able to find the ones you’re looking for faster if you display them alphabetically.
As you work with properties, you’ll find that most are set the way you want them by default. In addition, some properties such as Height and Width are set interactively as you size and position the form and its controls in the Form Designer window. As a result, you usually only need to change a few properties for each object.
A form after the properties have been set

Description
The Properties window displays the properties for the object that’s currently selected in the Form Designer window. To display the properties for another object, click on that object or select the object from the drop-down list at the top of the Properties window.
To change a property, enter a value into the text box or select a value from its drop-down list if it has one. If a button with an ellipsis (…) appears at the right side of a property’s text box, you can click on the ellipsis to display a dialog box that lets you set options for the property.
To change the properties for two or more controls at the same time, select the controls. Then, the common properties of the controls are displayed in the Properties window.
When you click on a property in the Properties window, a brief explanation of the property appears in a pane at the bottom of the window. For more information, press F1 to display the help information for the property.
You can use the first two buttons at the top of the Properties window to sort the properties by category or alphabetically.
You can use the plus (+) and minus (-) signs displayed to the left of some of the properties and categories in the Properties window to expand and collapse the list of properties.
Note
Figure 2-5. How to set properties
Please check back tomorrow for the conclusion to this article.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |
|
This article is excerpted from chapter two of Murach's Visual Basic 2008, written by Anne Boehm (Murach, 2008; ISBN: 1890774456). Check it out today at your favorite bookstore. Buy this book now.
|
|