BUG: Setting Value Property of Toolbar to Zero Clears Button

ID: Q140311


The information in this article applies to:
  • Standard, Professional, and Enterprise Editions of Microsoft Visual Basic, 32-bit only, for Windows, version 4.0


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

  1. Start Visual Basic, or on the File menu, click New Project (ALT, F, N).


  2. Add a toolbar.


  3. From the Toolbar Properties window, click the Custom property. Click the button to display the Toolbar Control Properties dialog box.


  4. In the Toolbar Control Properties dialog box, select the Buttons tab.


  5. Insert four buttons, each having a style of "Button Group."


  6. Click OK to exit the Toolbar Control Properties dialog box.


  7. Press F5 to run the application.


  8. 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.


  9. Click CTRL+BREAK to halt the program.


  10. 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.



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 : PrgCtrlsCus
Version : 4.00
Platform : WINDOWS
Issue type :


Last Reviewed: August 19, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.