我正在玩的应用程序中有很多复选框。所以,我决定改用 CheckedListBox。我用下面的代码遍历列表...
private void CheckedListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (CheckedListBox1.CheckedItems.Count != 0)
{
string x = "";
for (int x = 0; x <= ServicesCheckedListBox3.CheckedItems.Count - 1; x++)
{
x = x + "Checked Item " + (x + 1).ToString() + " = " + ServicesCheckedListBox3.CheckedItems[x].ToString() + "\n";
}
Line.Add(x);
}
}
输出给了我这个...
System.Collections.Generic.List`1[System.String].
我很新,从来没有见过这个。应用程序运行良好,但输出不正确。有什么建议么?