Microsoft KB Archive/201583

= BUG: Toolbar Does Not Resize to Fit the Caption of a Button =

Article ID: 201583

Article Last Modified on 5/12/2003

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q201583



SYMPTOMS
A toolbar control that is placed on a Visual Basic form and aligned with the left or right side of the form does not resize to fit a button that has a caption wider than the width of the toolbar.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
Steps to Reproduce Behavior


 * 1) In Visual Basic 6.0, create a new Standard EXE project. Form1 is created by default.
 * 2) On the Project menu, click Components, select Microsoft Windows Common Controls 6.0, and click OK.
 * 3) Place a Toolbar control on Form1.
 * 4) Place a CommandButton on the Toolbar by right-clicking it and selecting Properties. Click the Buttons tab and click Insert button.
 * 5) In the Properties dialog box, change the Caption property for the CommandButton to This is a long caption and click OK.
 * 6) In the Properties window, set the Align property for the Toolbar control to vbAlignLeft or vbAlignRight.
 * 7) Run the program. Note that the Toolbar control does not resize to fit the CommandButton, and the button appears to be clipped. Setting the Width or ButtonWidth property of the Toolbar control has no effect on the size of the control.

