Listbox with checkboxes

The place for threads about TimoSoft ComboListBoxControls
Post Reply
andromeda
Cadet
Posts: 3
Joined: 16 Jun 2011, 17:59

Listbox with checkboxes

Post by andromeda »

This control looks really great. Just a question from a newbie, how do you put the checkboxes in the listbox?

Many thanks
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: Unterföhring
Contact:

Re: Listbox with checkboxes

Post by TiKu »

Hi,

The native listbox control of Windows does not support checkboxes. For such a requirement a listview is the better choice. Take a listview, set it to Details view, make it hide the header, insert a column and then the items. You can make the column width equal the control width minus the control's border or you can make it autosize to the widest item.

The alternative is to make the listbox ownerdrawn and draw the checkboxes yourself. The Fonts and Colors sample demonstrates how to owner-draw a listbox.

Regards
TiKu
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Post Reply