BUG: Setting Value Property of Toolbar to Zero Clears Button

Last reviewed: October 3, 1996
Article 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 reference words: 4.00 4.00a vb4win vb432 buglist4.00
KBCategory: kbbuglist kbusage kbfixlist
KBSubcategory: PrgCtrlsCus


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 3, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.