SETTING PROPERTIES

When you select a control, the Properties window allows you to view and edit the control’s properties. For most properties, you can simply click the property and type a new value for the control. Some properties are more complex than others and provide drop-down lists or special dialog boxes to set the property’s value. Most of the editors provided for setting property values are fairly self-explanatory, so they are not described in detail here.

NOTE
You can press Ctrl+Z and Ctrl+Y to undo and redo changes in the Windows Form Designer, respectively, so you should feel free to experiment. You can change property values and add or remove controls and restore the form if you don’t like the changes.

In addition to using the Properties window to set a single control’s properties one at a time, you can quickly set property values for groups of controls in a couple of ways. The following sections describe some of the most useful of these techniques.

Setting Group Properties

If you select a group of controls, you can sometimes use the Properties window to give all of the controls the same property value all at once. For example, suppose you select a group of TextBoxes. Then you can use the Properties window to simultaneously give them the same values for their Anchor, Text, MultiLine, Font, and other properties.

Sometimes, this even works when you select different kinds of controls at the same time. For example, if you select some TextBoxes and some Labels, you ...

Get Visual Basic 2012 Programmer's Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.