Cindy,
We just had this little exchange over in the newsgroup.
Problems with using \ to disable items:
From Jim Nelson:
... and they WON'T be discernible in your code
... and you WON'T be able to change their status if you want to
... and disabled items may still be SELECTABLE using the keyboard
My reply:
First, I don't think I've ever put disabled items in a ListBox, if the user can't select it why show it in the list at all? And I'll admit the implementation in VFP could be cleaner, but all of the problems you mention can be fixed with a subclass.
You can discern the state if you use an array or a field that contains the \. The state can be changed by manipulation of the RowSource and calling the ListBox.Requery().
You can prevent keyboard access to disabled items with a little bit of code in the KeyPress (to track whether they are moving up or down the list) then in the
InteractiveChange methods can by finding the next appropriate enabled item and setting ListIndex.
>Hi, is there anybody can tell me how to disable the list item in the list box?
>
>Thanks!