Dialog Box Controls the Details

In the following sections I introduce you to each type of control you can use in custom dialog boxes and discuss some of the more useful properties. I don't discuss every property for every control because that would take up too much space (and would be very boring).

The Help system for controls and properties is thorough. To find complete details for a particular property, select the property in the Properties window and press F1. Figure 17-4 shows part of the online help for the ControlSource property.

Figure 17-4:

The Help system provides lots of information for each property and control.

(££) Microsoft Visual Basic Help ygB

ControlSource Property

Identifies the data location used to set or store the Value property of a control. The ControlSource property accepts worksheet ranges from Microsoft Excel. Syntax object. Contra (Source [= Sfn'rcg]

The ControlSource property syntax has these parts:

Part object


Required. A valid object,

Optional. Specifies the control.

'orksheet cell linked to the Value property of a

The ControlSource property identifies a cell or field; it does not contain the data stored in the cell or field. If you change the Value of the control, the change is automatically reflected in the linked cell or field, SimilarlVj if you change the value of the linked cell or field, the change is automatically reflected in the Value of the control,

You cannot specify another control for the ControlSource, Doing so causes an error, The default value for ControlSource is an empty string. If ControlSource contains a value other than an empty string, it identifies a linked cell or field. The contents of that cell or field are automatically copied to the Value property when the control is loaded,

Note If the Value property is Null, no value appears in the location identified by ControlSource.

All of the sample files in this section are available at this book's Web site.

0 0

Post a comment