Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Disabling ComboBox When No Data
Message
From
09/10/2007 13:31:42
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
01259788
Message ID:
01259802
Views:
23
>I am creating a parent ComboBox class. I want it to automatically disable when nothing is in the combobox; in other words,
>
>ComboBox.Enabled = (ComboBox.ListCount > 0)
>
> I have tried putting the above code into the When, Requery, Refresh, ListCount_Access, ProgrammaticChange, and other methods, but nothing seems to work. None of them fire when the ListCount changes.
> How can I get it to enable/disable whenever the ListCount changes?

How about calling a .refresh whenever it changes? And it can change in .addItem(), .addListItem(), .clear(), .removeitem(), .removelistitem() and .requery() - and put your enabled= line in the .refresh().

Um... a parent class which would be smart enough to do that even if any of these methods are overridden anywhere down the hierarchy tree? Tough.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform