Page 432 - Microsoft Office Excel 2003 Programming Inside Out
P. 432

Part 5:  Manipulating Excel Objects
                                        Microsoft Office Excel 2003 Programming Inside Out

                             You can hide the characters entered into a text box by specifying a value for the PasswordChar
                             property. This property is typically used to hide password information. Typically, an asterisk
                             (*) is used for this property. Set this property to the empty string to display the actual char­
                             acters entered.

                             The MaxLength property specifies the maximum number of characters that can be entered
             Chapter 19
                             into the TextBox, and the TextLength property returns the total length of the text. Notice that
                             TextLength will include carriage return and linefeed characters in the count when they are
                             present in a multi-line text box. If the AutoTab property is True, the focus will be shifted to
                             the next control in the tab sequence when the maximum number of characters have been
                             entered into the control.


















                    The CheckBox Control
                             The CheckBox control provides the user a way to chose between two values, such as Yes and
                             No, True and False, and Enabled or Disabled. The text in the Caption property is displayed
                             next to the check box.

                             The Click and Change events in this control accomplish the same thing because to change the
                             check box’s value, the user simply clicks anywhere over the control, including the caption.
                             You can display the value of the CheckBox control by using code like this in the check box’s
                             Click event:

                             Private  Sub  CheckBox1_Change()

                             MsgBox  "Value  of  checkbox  is  "  &  CheckBox1.Value
                             End  Sub













                406
   427   428   429   430   431   432   433   434   435   436   437