Hi Michael,
What does *doesn't work* mean? Is there some compiler error message? It has
to work as long as the myControl is public. I suppose frmMain is the member
variable of the *other* class and it is initilized with the reference to the
form.
Make sure as well that the frmMain's type is the type that has myControl
field.
for example:
class MyForm: Form
{
public Control myControl = .....
}
if you have
Form frmMain = <reference to MyForm object>
and you try
frmMain.myConrt rol.....
it won't work because Form class doesn't have myControl member variable.
However, if you have
MyForm frmMain = <reference to MyForm object>
frmMain.myContr ol....
has to work.
HTH
B\rgds
100
"Michael Ramey" <ra*****@hotmai l.com> wrote in message
news:eu******** *****@TK2MSFTNG P09.phx.gbl...
How can controls on a Windows Form be accessed (or referenced) from
another Class? I know how to do it from another Form. The following doesn't work
even though the Control Modifiers property is set to "Public":
frmMain.myContr ol
Thanks.
Michael