C#CheckedListBox多列

And*_*ann 5 c# checkbox multiple-columns winforms

我在C#中有一个checkboxlist控件。

我想知道谁在其中添加多列。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;
    }
}
Run Code Online (Sandbox Code Playgroud)

您能帮我示范正确的方法吗?

Rez*_*aei 5

尽管CheckedListBox具有MultiColumn属性,您可以将其设置为true,但是它仅根据控件的高度将项目列表排列在多列中,使项目从上到下然后从右到右流动

? 1         ? 5
? 2         ? 6
? 3         ? 7
? 4
Run Code Online (Sandbox Code Playgroud)

因此,如果您确实需要多列,请考虑使用DatGridViewListView真正的多列控件。