Microsoft Office Tutorials and References
In Depth Information
3.2 The Properties Window
For instance, the following is the code for the Close button's Click event in Figure 3-3 . Note that
the Name property of the command button has been set to cmdClose :
Private Sub cmdClose_Click()
Unload Me
End Sub
All this code does is unload the form.
Along with event code for a form and its controls, we can also include support procedures within
the UserForm object.
Don't worry if all this seems rather vague now. We will devote an entire chapter to creating
custom dialog boxes (that is, UserForm objects) later in the topic and see several real-life
examples throughout the topic.
3.2 The Properties Window
The Properties window (see Figure 3-1 ) displays the properties of an object and allows us to
change them.
When a standard module is selected in the Project window, the only property that appears in the
Properties window is the module's name. However, when a workbook, sheet, or UserForm is
selected in the Projects window, many of the object's properties appear in the Properties window,
as shown in Figure 3-4 .
The Properties window can be used to change some of the properties of the object while no code is
running—that is, at design time . Note, however, that some properties are read-only and cannot be
changed. While most properties can be changed either at design time or run time , some properties
can only be changed at design time and some can only be changed at run time. Run-time
properties generally do not appear in the Properties window.
Figure 3-4. The Properties window
Search JabSto ::

Custom Search