PRB: THREED Check Box Is Not Grayed Out When Value = 2 in VB

Last reviewed: June 21, 1995
Article ID: Q87771
The information in this article applies to:

- Professional Edition of Microsoft Visual Basic for Windows,

  versions 2.0 and 3.0
- Microsoft Professional Toolkit for Microsoft Visual Basic programming
  system for Windows, version 1.0

SYMPTOMS

If the Value property of a THREED Check Box is set to 2, the check box is not made unavailable (grayed out), as you might expect. Instead, an X is displayed in the THREED Check Box. If the Value property of a standard Visual Basic for Windows check box is set to 2, the check box is made unavailable.

CAUSE

There is no disabled state for a THREED check box. The value property of a THREED check box can only be true or false (0 or 1) whereas the standard check box can have a value of 0, 1, or 2.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Start Visual Basic or from the File menu, choose New Project (ALT, F, N) if Visual Basic is already running. Form1 is created by default.

  2. From the File menu, choose Add File. In the Files box, select the THREED.VBX custom control file.

  3. Place one THREED Check Box, one standard check box, and three command buttons on Form1.

  4. Enter the following code in the appropriate event procedures:

       Sub Form_Load ()
          Command1.Caption = "Value = 0"
          Command2.Caption = "Value = 1"
          Command3.Caption = "Value = 2"
       End Sub
    
       Sub Command1_Click ()
          Check1.Value = 0
          Check3D1.Value = 0
       End Sub
    
       Sub Command2_Click ()
          Check1.Value = 1
          Check3D1.Value = 1
       End Sub
    
       Sub Command3_Click ()
          Check1.Value = 2
          Check3D1.Value = 2
       End Sub
    
    

  5. Press F5 to run the program. First, click the Value = 0 button. Then click the Value = 1 button. Finally, click the Value = 2 button. When you click the Value = 2 button, the standard check box is disabled (grayed) but the THREED check box is not.


Additional reference words: 1.00 2.00 3.00 grey greyed 3d
KBCategory: kbprg kbcode kbprb
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: June 21, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.