This document is archived and information here might be outdated. Recommended version. |
Updates the enabled state of the specified item or all items if an index of -1 is specified. Specify fullUpdate to update the group, group spacing, style and bitmap properties.
[Visual Basic .NET] Public Sub Update ( _ [ByVal index As Integer], _ [ByVal fullUpdate As Boolean] _ )
[C#] public void Update ( int index, bool fullUpdate );
[C++]
HRESULT Update(
long index,
VARIANT_BOOL fullUpdate
);
[C++]
Parameters index [in, optional, defaultvalue()]
index is a parameter of type long fullUpdate [in, optional, defaultvalue()]
fullUpdate is a parameter of type bool
The primary job of the Update method is to ensure that each item on the ToolbarControl is synchronised with the ICommand properties of the IToolbarItem::Command.
By default the index argument is -1, and each item on the ToolbarControl is updated. To update a specific item, specifiy its index. The item at the beginning of the collection to the left of the ToolbarControl has an index of 0.
By default the fullUpdate argument is false, and each item is updated to reflect its ICommand::Enabled, ICommand::Caption and ICommand::Checked properties. Pass true to Update to additionally update the following properties: ICommand::Bitmap, IToolbarItem::Style, IToolbarItem::Group and IToolbarItem::GroupSpacing properties.
By default the Update method is called automatically on a regular interval specified by the UpdateInterval to ensure that the ToolbarControl item's reflect the current application state. This updates all items, but with a fullUpdate argument set to false.
1023 800a03ff: The specified index is out of range
The Update method checks each commands ICommandPool::Created property. If the command has not been created the ICommandPoolEdit::Hook property is passed into the ICommand::OnCreate method. The hook it typically the ToolbarControl.
When using the Update method to update each item on the ToolbarControl pass -1 as the index argument. Failing to do will result in only the item at index 0 being updated.
axToolbarControl1.Update(-1, false)
When using the Update method to update each item on the ToolbarControl pass -1 as the index argument. Failing to do will result in only the item at index 0 being updated.
AxToolbarControl1.Update(-1, False)