Restores a toolbar, created with a Toolbar control, to its original state after being customized.
Syntax
object.RestoreToolbar(key As String, subkey As String, value As String)
The RestoreToolbar method syntax has these parts:
Part | Description |
object | Required. An object expression that evaluates to a Toolbar control. |
key | Required. A string expression that specifies the key in the Windows registry where the method retrieves the Toolbar information. |
subkey | Required. A string expression that specifies a subkey under the key parameter in the registry. |
value | Required. A string expression that identifies the value under the subkey where the Toolbar information is stored in the registry. |
Remarks
Warning When the RestoreToolbar method is used, any toolbar buttons that do not contain ImageList ListImage object will disappear. A user can make them visible again by using the Reset button on the Customize Toolbar dialog box. You can use the Customize method to programmatically invoke this dialog box for the user.
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.
The state of the toolbar can be saved in the registry using the SaveToolbar method. The RestoreToolbar method restores the state of a toolbar by reading the registry.
The following code restores the Toolbar control's settings for the current user, assuming they have previously been saved with the SaveToolbar method.
Toolbar1.RestoreToolbar "AppName", "User1", "Toolbar1"