0
我已经试过别人建议使用这种类型并以某种方式设法运行它,但现在我已经用同样的方式,但有一个错误呼叫Form2的财产(Form1中)
错误:“ FYP.Form6.listBox1' 不可访问由于其保护级别
函寄以下
Form6 frm4 = new Form6(this.listbox1);
for (int i=0;i<frm4.listBox1.Items.Count;i++)
{
// <P>
xmlWriter.WriteStartElement("P");
xmlWriter.WriteAttributeString("","DISP","",frm4.listBox1.Items[i].ToString());
xmlWriter.WriteString(frm4.listBox2.Items[i].ToString());
// </P>
xmlWriter.WriteEndElement();
}
他正在使用this.listbox1。那么,它是否真的很重要,如果它有任何访问说明符。 – 2009-12-19 12:39:02
'this.listbox1'可能被用来填充Form6的listBox1。错误在'frm4.listBox1'处抛出,而不是'this.listbox1'。无论如何,只是我的猜测,因为我们不知道“Form6(ListBox)”的构造函数中发生了什么。:) – 2009-12-19 12:45:50