Programming with Reflection

image\rwnprg32.gif DefineButton method


Syntax object.DefineButton Index, Separator, Picture, Text, Help, Cmds



Defines a toolbar button.


Index Argument type: Integer
Toolbar buttons are numbered using an index of 1 for the leftmost or top button, and so on. If you use an index value of 0, a new button is inserted at the beginning of the toolbar. If you use an index value greater than the number of existing buttons, a new button in inserted at the end of the toolbar. Use the AddButton method before DefineButton to add a new button somewhere in the middle of the toolbar. Otherwise, if you use an index value equal to the index of an existing button, the existing button is replaced.

Separator Argument type: Boolean
If the value of this argument is rcYes, a separator is inserted between this button and the button to its left. If the value is rcNo, no separator is used and the new button is grouped with the previous button.

Picture Argument type: String
Specifies a picture file name for the button. Supply complete path information. If no picture is to be displayed on the button, use an empty string ("") for this argument.

Text Argument type: String
Specifies text that is to appear on the button. This argument can be up to 40 characters long.

Help Argument type: String
Specifies status bar text for the button. This text is visible in the status bar or title bar when you hold down the left mouse button over the button. This string can be up to 128 characters long, though the number of characters actually visible is likely to be somewhat less, depending on the size of the window.

Cmds Argument type: String
The Reflection method or sequence of methods to be executed when the button is clicked. This string can be up to 260 characters long.

Note: The DefineButton method allows you to update only the Standard toolbar and does not include arguments for all available button features. To be able to modify all button features on all of your toolbars, use the newer DefineToolbarButton method. If there is no Standard toolbar, DefineButton is ignored.


image\jump.gif Keyword Index

image\popup.gif Related Topics

image\popup.gif Reflection products that use this command