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

故事扮演 提交于 2019-12-01 03:24:36

问题


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


回答1:


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.




回答2:


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!!



来源:https://stackoverflow.com/questions/22279811/how-to-set-space-between-items-in-a-checked-list-box

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!