tags:

views:

839

answers:

2

I have a combobox from which i need to programmatically disable items depending on an external event. The external event is done, I just need to disable the selection of the item and have it greyed out (like a context menu when certain options aren't available).

It was decided that having items simply disappear would confuse users but having them greyed out like menu items would be familiar.

How do you do that in VB6?

+3  A: 

There is no way to do this with the stock VB6 combobox. You can simulate it in any third-party combobox that supports owner-drawing. vbAccelerator's version supports this and is open-source.

rpetrich
A: 

This can not be done with a combobox. You could get a similar result with a listbox, though.

Bobwise
The form space is pretty limited so that is not a option. In the end we decided that removing the items would be acceptable faced with a lengthier development time (it's currently in testing now).
graham.reeds