RepeatDirection Property for CheckedListBox C#

倖福魔咒の 提交于 2019-12-20 01:11:11

问题


so I'm very confused here. I want to make my multilined CheckedListBox to be sorted horizontally. I've done some research and it is all leading to the RepeatDirection property. Example in the MSDN

But I don't have a web page and I don't know any XML. Can't I just somehow use this property for the CheckedListBox Control? The MSDN people say it is already a property of that Control as they simply have written:

public virtual RepeatDirection RepeatDirection { get; set; }

I just can't seem to understand how to implement this in my code! Thanks in advance.

EDIT: I don't have a web form! It is a System.Windows.Formsproject. I just tagged web-controls because the RepeatDirection property seems to exist in the System.Web.UI.WebControls namespace.


回答1:


Short answer: You can't. ListBox as implemented in the Windows Forms does not support repeating horizontally. You aren't using the web version of the control, so you can't use the web version's options.

If you still need to display your options horizontally you will need to use a different control. Depending on your requirements, a DataGridView should be able to do what you are wanting, with some tweaking.



来源:https://stackoverflow.com/questions/28579521/repeatdirection-property-for-checkedlistbox-c-sharp

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