Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Listbox with Checkbox

Hi

I'm not sure this is possible but here goes.

I have set up a list box that is displaying a list of items from a different (longer) list. When the listbox is displayed it checks whether each item in the listbox has a corresponding .def file or not. If the corresponding def file is found the item is checked in the listbox (which is what I wanted).

Can I set the listbox so it cannot be checked or unchecked by the user? I can't disable it since the contents of the def file is displayed when the item is clicked.

Thank you.
[573 byte] By [chagen] at [2007-11-11 7:37:58]
# 1 Re: Listbox with Checkbox
you can catch the event (I do not remember which one: ItemCheck?) and force back to checked/unchecked depending of the status of the item.
But that is a bad user interface. Check boxes are used to let the user make a decision or a choice, not to display a status. In situations like this one, I prefer to use a ListView in report mode, with two columns: the first column for the name of the item, and the second for the "status" (like a simple string like OK). Or a single column, using the icon to display two different images, according to the status of the item.
You can use a simple listbox with multicolumns, but it is not as elegnt (and flexible) as the ListView.

Marco
mstraf at 2007-11-11 17:26:41 >