views:

26

answers:

1

I have a CheckedListBox in my Windows forms application, but items can be added that are to wide for the control to display. Is there any way to have the text wrap to the next line when this occurs?

I know with a standard ListBox this would not work, since it would be hard to tell the difference between the second line of one item and the next item. But with a CheckedListBox the beginning of the items in the list are defined by the CheckBox, so it should be easy to differentiate between items.

Is this possible? Will I have to create my own control (Again)?

+2  A: 

The CheckedListBox does not support this, but you can use a DataGridView with two columns (checkbox column, text column) to achieve this with very little effort.

Tergiver
I have been playing with the DataGridView as you suggested, but how do I get it to highlight both columns when selecting one of them? do I have to do this programmatically, or is there a setting for this?
Tester101
SelectionMode = FullRowSelect
Tergiver
Maybe I should have said, "very little effort if you have abused the DGV in this way many times before.. minimal effort otherwise" ;)
Tergiver
Sorry, it would have probably been easier if I used an IDE.
Tester101