Help and Support
 

powered byLive Search

PRB: Enabled Property of Label Does Not Change Appearance

Article ID:180771
Last Review:March 11, 2005
Revision:2.1
This article was previously published under Q180771

SYMPTOMS

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

Back to the top

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
				

Back to the top

STATUS

This behavior is by design.

Back to the top

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 in the RESOLUTION section of this article correctly alters the appearance and availability.

Back to the top


APPLIES TO
Microsoft Windows CE Toolkit for Visual Basic 6.0
Microsoft eMbedded Visual Basic 3.0

Back to the top

Keywords: 
kbtoolkit kbprb kbpending KB180771

Back to the top

Article Translations

 

Other Support Options

  • Need More Help?
    Contact a Support professional by E-mail, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.