Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set space between items in a checked list box?

I'm developing a windows form application using c#. How can I set a space between items in a checked list box?

enter image description here

like image 555
Amila Iddamalgoda Avatar asked Mar 09 '14 08:03

Amila Iddamalgoda


2 Answers

You can't, increasing the font size is all you got. Not exactly a control that's suitable for a touch screen. You can re-implement it with ListBox.DrawMode and ControlPaint.DrawCheckBox().

The better selection here is a ListView with View = Tile, easy to hit with your thumb when you make the tile big enough. You can't use ListView.CheckBoxes anymore, using an icon is a good choice. Also automatically takes care of the user only selecting one item.

like image 130
Hans Passant Avatar answered Nov 08 '22 11:11

Hans Passant


Looks like you could go with a ListView (which always always always ist the better choice anyway) and a (dummy) imagelist. See here and here.

Just tried it and it's really easy: Add an imagelist to your form; set its imagesize width to something small and its height to your liking and apply it as the listview's stateimagelist. No need for any actual images.

No need to go for tiles and you could add prices in a 2nd column, even with a different font.. ListView rules ;-)

Let us see the final result! Yumm!!

like image 44
TaW Avatar answered Nov 08 '22 13:11

TaW