freddy,
In order to do it the way that you want to, you have to set the
txtUsername field in the frmlaptopChk class to public or internal (assuming
these forms are hosted in the same assembly), so that you can access the
field.
However, I would have the frmlaptopChk class fire an event when the
textbox changes, and have the other form respond to that event. It's a much
better design, and doesn't tightly couple everything together.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"freddy" <fr****@discussions.microsoft.comwrote in message
news:CC**********************************@microsof t.com...
>I am learning c# and I have a problem. I would like to enter a username in
form A textbox and have it apper in form B testbox.
I have something like this
frmlaptopChk laptop = new frmlaptopChk();
txtusername.Text = laptop.txtUsername.Text ();
and when i run it, I get inaccessible due to its protection level
*Not this is from form B testbox