Dom wrote:
I selectively "disable" certain items in a ListBox. They appear gray
and italicized. I want to make sure the user never selects these. Is
there a way I can do this? For example, can I capture
"SelectedItemChanged" and simply cancel it so that there will no
subsequent call to DrawItem?
Please read the rest of my reply to your previous thread, the same one
in which I explained the technique you're using now to change the way
the text is drawn. It addresses this very question.
And no, you can't just cancel the "SelectedItemChanged" event. The
ListBox doesn't have that event, and the related events
"SelectedIndexChanged" or "SelectedValueChanged" are not a cancelable
events.
Pete