I try to assign textbox
value to another class, but I do only this in main class :
public string TextBox1Text
{
get { return textBox1.Text; }
set { textBox1.Text = value; }
}
How can I assign this value in second class?
create the same property in the second class and pass it over in the main class:
public class SecondClass
{
public string TextBox1Text { get; set; }
}
public class MainClass
{
SecondClass sc = new SecondClass();
public string TextBox1Text
{
get { return textBox1.Text; }
set { textBox1.Text = value; }
}
public MainClass
{
sc.TextBox1Text = this.TextBox1Text;
}
}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments