Initializing Control Properties
You can initialize controls at run time by using Visual Basic code in a macro. For example, you could fill a list box, set text values, or set option buttons.
The following example uses the AddItem method to add data to a list box. Then it sets the value of a text box and displays the form.
|
You can also use code in the Intialize event of a form to set initial values for controls on the form. An advantage to setting initial control values in the Initialize event is that the initialization code stays with the form. You can copy the form to another project, and when you run the Show method to display the dialog box, the controls will be initialized.
|
See Also
- Displaying a Custom Dialog Box
- How to: Add Controls to a Document
- How to: Add Controls to a User Form
- How to: Create a Custom Dialog Box
- How to: Create a User Form
- Setting Control Properties
- Using ActiveX Controls on a Document
- Using ActiveX Controls on Sheets
- Using Control Values While Code Is Running