At run time, saves the state of a toolbar, created with the Toolbar control, in the registry.
Syntax
object.SaveToolbar(key As String, subkey As String, value As String)
The SaveToolbar method syntax has these parts:
Part | Description |
object | Required. An object expression that evaluates to a Toolbar control. |
key | Required. A string expression specifying the key in the registry where the method stores the Toolbar information. |
subkey | Required. A string expression that specifies a location in the registry under the key parameter. |
value | Required. The Toolbar information to be stored in the subkey. |
Remarks
To customize the Toolbar control at run time, use the Customize method in code or if the AllowCustomize property is True, the user can customize it by double clicking the control.
If the key, subkey, or value you specify doesn't exist in the registry, it is created.
To save more than one version of the toolbar, you can change the subkey or value parameter. This causes the toolbar to write to a different part of the registry. The following code saves two different states of a toolbar after it has been customized.
' Save settings for User1
Toolbar1.SaveToolbar "AppName", "User1", "Toolbar1"
' Save settings for User2
Toolbar1.SaveToolbar "AppName", "User2", "Toolbar1"
Since the Change event for the Toolbar control occurs after the toolbar has been customized, in most cases the above code can be placed in the Change event for the toolbar.