Microsoft Office Tutorials and References
In Depth Information
Displaying, loading, and hiding UserForms
7
With the new spin button still selected, in the Properties panel, enter 49 in the Max
field. The spin button will now accept values from 0 to 49.
8
In the Toolbox , click the SpinButton button, and then draw a new spin button to the
right of the text box beside the Ounces label.
9
With the new spin button still selected, in the Properties panel, enter 15 in the Max
field. The spin button will now accept values from 0 to 15.
10
Click the spin button to the right of the text box below the Pounds label and make a
note of its name (which is probably SpinButton1).
11
Right-click the spin button below the Pounds label and then click View Code . In the
code window that appears, edit the code so it reads as follows.
Private Sub SpinButton1_Change()
TextBox1.Value = SpinButton1.Value
End Sub
TROUBLESHOOTING The preceding code assumes the text box is named TextBox1
and the spin button is named SpinButton1. If they aren’t, edit the code to reflect the
controls’ actual names.
12
Right-click the spin button below the Ounces label, and then click View Code . In the
code window that appears, edit the code so it reads as follows.
Private Sub SpinButton2_Change()
TextBox2.Value = SpinButton2.Value
End Sub
13
In the Project window, double-click the UserForm1 icon to return to the UserForm.
14
Click on the body of the UserForm and then, in the Toolbox , click the ListBox
button. Draw a list box below the text boxes that display the Pounds and Ounces values.
Your list box should be wide enough to display the text string Priority Overnight .
15
With the list box still selected, in the RowSource property box of the Properties panel,
enter =ShipMethods and then press Enter . The methods appear in the list box.
 
Search JabSto ::




Custom Search