Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to tell if a listbox item is disabled?
Message
From
08/01/1997 08:54:37
Bill Gravell
Indoor Purification System
Menifee, California, United States
 
 
To
08/01/1997 04:27:55
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00016664
Message ID:
00016738
Views:
68
>>I have found that the old 2.6 method of disabling a specific item in a listbox ("\" + text) still disables
>>an item in a 5.0 listbox. Once disabled though, how, in code does one recognize a disabled item? The "\" is not part of the text in a listbox item and .Enabled if for the entire listbox not a specific item.
>
>As far as I can see, you don't know something is disabled.
>
>As you say, the "\" is not returned as part of the .list[] property so you can do things like .list[.listindex] = .list[.listindex] to remove the disabled flag which will always work.
>Similarly .list[.listindex] = "\"+.list[.listindex] will always work without adding more and more "\" characters to the value.
>
>It's quite tricky the way it is...
>
>
>Why do you want to know if something is enabled?
>Surely if it's not enabled the user can't have chosen it?

Have you tried setting a different DisabledItemForeColor property for the listbox? The default has both enabled and disabled colors the same. I tried it and it does work.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform