A Buttons object is a collection of Button objects. A Button object represents an individual button in the Buttons collection of a Toolbar control.
ToolBar.Buttons
ToolBar.Buttons(index)
ToolBar.Button(index)
index:Variant
The ToolBar.Buttons property returns a reference to the Buttons object, a collection of Button objects.
ToolBar.Buttons(index) or Button(index) returns a reference to the Button with the given index (integer or string).
For each Button object, you can add text or a bitmap image, or both, from an ImageList control, and set properties to change its state and style. You can manipulate Button objects using standard collection methods (for example, the Add and Remove methods). Each element in the collection can be accessed by its index, the value of the Index property, or by a unique key, the value of the Key property.
The Buttons properties and methods:
Add | Clear | Count | Item | Remove
The Button properties and methods:
Caption | Checked | Enabled | Height | Hidden | Image | Indeterminate | Index | Key | Left | Pressed | Style | Tag | ToolTipText | Top | Value | Width
Ocx ToolBar tlb
tlb.Add , "open" , "Open"
tlb.Add , "save" , "Save"
Debug.Show
Trace tlb.Button(1).Caption
Trace tlb.Buttons(2).Key
Trace tlb("open").Index
Do : Sleep : Until Me Is Nothing
{Created by Sjouke Hamstra; Last updated: 09/05/2020 by James Gaite}