Microsoft Office Tutorials and References
In Depth Information
21.18.1 Create the UserForm
The list box contains a list of all embedded charts in the active workbook. The user can select one
or more charts and hit the Print button.
The following are the steps to create the print utility. All the action takes place in the Print.xls
workbook, so open this workbook. When the changes are finished, you will need to save Print.xls
as Print.utl as well. If Print.utl is loaded, the only way to unload it is to unload the add-in
SRXUlils.xla (if it is loaded) and close the workbook SRXUtils.xls (if it is open).
21.18.1 Create the UserForm
Create the dialog shown in Figure 21-32 in the Print.xls workbook. Name the dialog
dlgPrintCharts , change its caption to "Print Charts," and change the PrintCharts
procedure to:
Public Sub PrintCharts()
dlgPrintCharts.Show
End Sub
The dlgPrintCharts dialog has two command buttons and one list box.
21.18.1.1 List box
Place a list box on the form as in Figure 21-32 . Using the Properties window, set the properties
shown in Table 21-9 .
Table 21-9. N ondefault Properties of the ListBox Control
Property
Value
Name
lstCharts
TabIndex
0
MultiSelect
frmMultiSelectExtended
The MultiSelect property is set to frmMultiSelectExtended so that the user can use the
Control key to select multiple (possibly nonconsecutive) entries and the Shift key to select
multiple consecutive entries.
The TabIndex property determines not only the order in which the controls are visited as the user
hits the Tab key, but also determines which control has the initial focus. Since we want the initial
focus to be on the list box, we set its tab index to 0.
21.18.1.2 Print button
Place a command button on the form as in Figure 21-32 . Using the Properties window, set the
properties shown in Table 21-10 .
Table 21-10. Nondefault Proper ties of the Print Button
Property
Value
Name
cmdPrint
Accelerator
P
Caption
Print
TabIndex
1
21.18.1.3 Cancel button
 
 
Search JabSto ::




Custom Search