VBCE.com - The Premier Website For Visual Basic/CE Developers

 

*Dev Corner

Sample Code
Controls
Workarounds
Tips & Tricks
Q & A
Forums

*Goodies
Downloads
Software
Bookstore


*General
Home
What's New
General Info
Misc. Info


*News Worthy
News
Articles
Editorials
KB Articles
Reviews
Awards

*Miscellaneous
Web Links
Partners
Search
Feedback
Advertising

<% On Error Resume Next SiteStats() %>

Sponsors


More...


Disable That Label!
By mike@vbce.com

    The bug that does not allow labels to look disabled (greyed) isn't that annoying for the programmer, but is does lend to a less intuitive interface presentation sometimes. When the labels Enabled property is set to false, it does disable it, but the appearance does not change.

    To workaround this bug, simply set for forcolor of the label each time the enabled property is changed:

'Disable the label
Label1.ForeColor = vb3DShadow
Label1.Enabled = False

'Enable the label
Label1.ForeColor = vbWindowText
Label1.Enabled = True

This will give us our desired look:

disablelabel.jpg (5980 bytes)

bug_word.jpg (1504 bytes)
bug_ant_1.gif (13248 bytes)
workaround.jpg (2931 bytes)

 

“When the bugs get tough,
the tough get coding!”

 


VBCE.com is DevX Winner!

Unless otherwise noted, all information on VBCE.com is Copyright 1998 - 2002
Windows, Windows CE, and Visual Basic are trademarks of the Microsoft Corporation.
VBCE.com is not responsible for content on external sites.
Send all feedback to webmaster@vbce.com
Webmasters - feel free to link to
VBCE.com - Premier Website for Visual Basic/CE Development

Buy Books!