我試圖從form2中獲取Form1中checkedboxlist中的項目。c#從form2中獲取formbox1中checkedboxlist的項目
我也把我的form1.checkedboxlist改性劑的propertie到PUBLIC
我能達到的名單,但我不能老是讓裏面的物品。當我用checkedboxlist.items.count它告訴我有什麼在我的名單,但事實並非如此
string[] list = new string[form1.ckdBoxList.Items.Count];
MessageBox.Show(list.Length.ToString());//In debug it tells me that the lenght is 0
for (int i = 0; i <= list.Length; i++)
{
list[i] = fenPrincipal.ckdBoxList.Items[i].ToString();
}
感謝你的幫助
是Form1中仍然開放,可見當您切換到FORM2? – mellamokb 2012-04-25 17:35:53