Toll Free: (877) 723-1442 U.S. and Canada
Support
ActiveX / COM
Visual C++ / MFC
Customer Spotlight
Corporate Partners
Contact Sales

Call center available M-F 9:00 - 6:00 US Eastern Time.

U.S. and Canada
(877) 723-1442

International
(517) 625-5729

Email

Setting the Size of ToolBar Icons when using LargeIcons

Author: Mike Palmatier
Posted: February 3, 2006
Environment: 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.



Toolbar using 54x54 sized 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

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Other products and/or company names may be trademarks or registered trademarks of their respective owners.