Dom,
Yes, you are thinking in VB.
By default, when adding controls to forms, the fields are added as
private. In the designer, you should go to the control and set the
visiblity (or accessiblity, it's something similar) from private to public.
However, I would say that this is a very, very bad idea from a design
standpoint. Rather, just expose properties that expose the details that you
are looking for and have the properties return them from the controls, if
you must.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Dom" <do********@gmail.comwrote in message
news:11**********************@e51g2000hsg.googlegr oups.com...
>I have a Main form called frmMain which appears when the program
starts, and a second form called frmUserName. frmMain has a button,
btnUserName. When you click it, I have this code:
frmUserName f = new frmUserName ();
f.ShowDialog(this);
For the next line, I expected to find f.txtUserName in the
IntelliSense window, but it's not there. In fact, noneof the controls
are there. Am I just caught in VB think?
Dom