I am attempting to carry the value of a single textbox into another textbox on another form.
In form 1 i have the following code:
private SecondForm secondForm;
public void SecondFormTextBox()
{
uname.Text = secondForm.uname.Text;
}
In form 2 I have the following code.
public TextBox uname
{
get
{
return uname;
}
}
I recieve the following errors, hope you can help!!
An object reference is required for
the non-static field, method, or
property
‘WindowsFormsApplication1.AdministratorHome.uname.get’Ambiguity between
‘WindowsFormsApplication1.AdministratorHome.uname’
and
‘WindowsFormsApplication1.AdministratorHome.uname’
Lets do an exampe with passing a value from textBox on form1 on button press, to a textBox on form2.
Code:
Hope it helps,
Mitja