eternal question about twoForms:
frm02 frm02 = new frm02();
frm02.Text = "Objects";
ds02 = new DataSet();
ds02.ReadXml(path02);
frm02.dgv02.DataSource = ds02.Tables[0]; //error: dgv02 is inaccessible...
frm02.ShowDialog();
pleaseHelp!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to make
dgv02public. By default, when you add types via the designer, they are not public. You can edit their properties in the design window, and change the accessibility level to public.That being said, a better option might be to create a public property that returns the appropriate control, or, even better, allows you to set the data. For example, if you add this method to your form:
You could then call this as: