我在Windows窗体中有一个CheckedListBox
控件。
我想知道是谁在其中添加多列。MultiColumn
属性设置为true。我只想知道添加2列的编码。
我的代码是
while (true)
{
data = SDK.GetNext("ACCHISTL", 6);
document_details = data.Split('|');
if (document_details[0] == "0")
{
if (document_details[3] == Document_nr)
{
lbLines.Items.su(document_details[4] + " -> " + document_details[14],true);
}
else
{
break;
}
}
else
{
break;
}
}
您能帮我示范正确的方法吗?
尽管CheckedListBox
具有MultiColumn
属性,您可以将其设置为true,但是它仅根据控件的高度将项目列表排列在多列中,使项目从上到下然后从右到右流动]]
■ 1 ■ 5 ■ 2 ■ 6 ■ 3 ■ 7 ■ 4
因此,如果您确实需要多列,请考虑使用真正的多列控件
DatGridView
或ListView
。
将MultiColumn
属性设置为true不允许您手动添加更多列。它仅将项目“包装”到下一列,而不是在项目超过CheckedListBox
的高度时显示垂直滚动条。