Microsoft KB Archive/140311

= BUG: Setting Value Property of Toolbar to Zero Clears Button =

Article ID: 140311

Article Last Modified on 12/9/2003

-

APPLIES TO


 * Microsoft Visual Basic 4.0 Standard Edition
 * Microsoft Visual Basic 4.0 Professional Edition
 * Microsoft Visual Basic 4.0 Professional Edition
 * Microsoft Visual Basic 4.0 16-bit Enterprise Edition
 * Microsoft Visual Basic 4.0 32-Bit Enterprise Edition

-



This article was previously published under Q140311



SYMPTOMS
Setting the Value property of a Toolbar button group member to zero at run time causes that button to become cleared regardless of whether or not it is the selected button.



MORE INFORMATION
Within a button group, one button and only one button should remain checked at all times. If another button is checked, the first button becomes cleared.

The only way to clear a button that is member of a button group is to check another member of that group.

This is the expected behavior.

Steps to Reproduce the Problem
 Start Visual Basic, or on the File menu, click New Project (ALT, F, N). Add a toolbar. From the Toolbar Properties window, click the Custom property. Click the button to display the Toolbar Control Properties dialog box. In the Toolbar Control Properties dialog box, select the Buttons tab. Insert four buttons, each having a style of "Button Group." Click OK to exit the Toolbar Control Properties dialog box. Press F5 to run the application.</li> Click the various buttons and observe the selection behavior. Only one button is depressed at a time. You cannot clear a button that has been depressed.</li> Click CTRL+BREAK to halt the program.</li>  Type the following code in the debug window: Toolbar1.Buttons(x).value=0 'where x = button # that is depressed The result is that all buttons are now cleared. </li></ol>

<div class="status_section">

STATUS
Microsoft has confirmed this to be a problem in Visual Basic version 4.0 for Windows. This problem has been corrected in the Visual Basic version 4.0a for Windows synchronization release.

Additional query words: 4.00 4.00a vb4win vb432 buglist4.00

Keywords: kbbug KB140311

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.