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

Part 5:  Manipulating Excel Objects
                                                        Command Bars

                             Table 17-5.  Key Properties and Methods of the CommandBarControl
                             Object  (continued)
                             Property/Method     Description
                             Tag	                Property: contains programmer-defined information. This property
                                                 can be used with the CommandBar.FindControl method to help
                                                 locate a particular control.
                             TooltipText	        Property: contains text that will be displayed if the user hovers the
                                                 mouse pointer over the control. By default, the value from the
                                                 Caption property will be displayed.
                             Top	                Property: contains the distance between the top edge of the
                                                 command bar control and the top edge of the screen.
                             Type                Property (read-only): indicates type of the command bar control.
                             Visible	            Property: True when the CommandBarControl is displayed on the
                                                 screen. Remember that the Enabled property must be True before
                                                 you can set this property to True.
                             Width               Property: contains the width of the command bar control in pixels.

                             When the user clicks or selects a command bar control, the subroutine specified in the
                             OnAction property is fired. You also have the option to execute the routine associated with
                             the command bar control by using the Execute method.
                             The Parameter and Tag properties are simply areas in which you can store additional infor­
                             mation about the specific instance of the control. The Tag property can be useful if you want
                             to locate a specific control based on its Tag value with the FindControl method. You could
                             create a common OnAction routine that performs various actions based on the specific value
                             in the Parameter property for each control.

                             The Copy and Move methods allow you to relocate controls from one command bar to
                             another, and the Delete method will remove the control from the command bar and the
                             application.

                    Button Controls

                             There is only one specific type of button control, which is msoControlButton. This object is   Chapter 17
                             useful in situations where you wish to execute a subroutine in response to the user pressing a
                             button or selecting a menu item. Table 17-6 lists the unique properties and methods for the
                             CommandBarButton object when compared with the base CommandBarControl object.












                                                                                                       375
   396   397   398   399   400   401   402   403   404   405   406