G
Geoffrey Collier
I have created a form (form1) with some objects on it. I
then created a new class in the same file that has the
form1 code. It is in the same namespace. I now want to
address the objects on form1, but I can't get the new
class to "see" these objects. I get an
error "Form1.rtxt_output is inaccessible due to its
protection level". (Form1 is public). What gives?
The code is below.
public class testclass
{
//VARIABLES
int i;
int j;
char c;
string s;
float f;
double d;
double[] myarray=new double[10];
private testclass()
{
} //default constructor.
public void display()
{
for(i=0;i<10;++i)
{
//START HERE: I can't figure out
why I can't reference rtxt_output here.
//rtxt_output.Text="hello";
} //for i
}//display
}//testclass
then created a new class in the same file that has the
form1 code. It is in the same namespace. I now want to
address the objects on form1, but I can't get the new
class to "see" these objects. I get an
error "Form1.rtxt_output is inaccessible due to its
protection level". (Form1 is public). What gives?
The code is below.
public class testclass
{
//VARIABLES
int i;
int j;
char c;
string s;
float f;
double d;
double[] myarray=new double[10];
private testclass()
{
} //default constructor.
public void display()
{
for(i=0;i<10;++i)
{
//START HERE: I can't figure out
why I can't reference rtxt_output here.
//rtxt_output.Text="hello";
} //for i
}//display
}//testclass