I have tried others suggestion for using this type and somehow manage to run it, but now I have using the same way but having an error as
Error :‘ FYP.Form6.listBox1’ is inaccessible due to its protection level
I am enclosing code below
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();
}
My guess, the
Modifiersproperty oflistBox1control of theForm6form is set to ‘private’. Up it tointernalorpublic.