BUG: Enabled Property of Label Does Not Change Appearance

Last reviewed: February 10, 1998
Article ID: Q180771
The information in this article applies to:
  • Windows CE Toolkit for Visual Basic 5.0, version 1.0

SYMPTOMS

Setting the Enabled property of a Label control to False does not change the appearance of the label (gray out) as expected.

RESOLUTION

The workaround is to add code to handle the appearance of the label control whenever setting the Enabled property to False, and also to add code to restore its appearance when setting the Enabled property to True. For example:

   'To disable a label:
   Label1.ForeColor = vb3DShadow
   Label1.Enabled = False

   'to enable a label:
   Label1.ForeColor = vbWindowText
   Label1.Enabled = True

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Changing the Enabled property of a control causes two actions: a change in availability to the user and a change in visual appearance.

When a control-Enabled property is set to False, the control is not available (cannot receive the focus) and the appearance becomes grayed out to indicate unavailability.

Changing the Enabled property of a Label control affects the availability of the control, but it does not change the appearance to match. The code workaround above causes both the appearance and availability to be altered correctly.

REFERENCES

Online Book for Microsoft Windows CE Toolkit for Visual Basic 5.0


Additional query words: 10 wce disable
Keywords : vb5all vbce
Version : WINDOWS:1.0
Platform : WINDOWS
Issue type : kbbug
Solution Type : kbpending


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: February 10, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.