CommandBars Articles and Tutorials

Setting the Size of ToolBar Icons when using LargeIcons

Author: Mike Palmatier
Platform: Visual Basic 6.0

You can specify which size icon should be used when the CommandBars.Options.LargeIcon property is set to True. To do this, use the CommandBars.Options.SetIconSize method. Passing in a value of True for the first parameter specifies that the specified size will be used when LargeIcons are displayed. If False, then the largest set of icons added will be used. If you do not supply a larger icon size, then the closest size icon to the one you are trying to display will be "stretched" to the specified size.

Toolbar using 24x24 sized icons.
24x24 Toolbar Icons

Toolbar using 54x54 sized icons.
54x54 Toolbar Icons

The code below will set the size the ToolBar icons to 32x32 when CommandBars.Options.LargeIcons are enabled.

CommandBars.Options.LargeIcons = True
CommandBars.Options.SetIconSize True, 32, 32