I have a label called LabelX1. This is on form2. On form1, i have a button. I want the button\'s text to be transferred to the other form\'s label. I have tried
<
You need to expose your label or its property.
In form 2:
public string LabelText { get { return this.labelX1.Text; } set { this.labelX1.Text = value; } }
Then you can do:
form2 frm2 = new form2(); frm2.LabelText = this.button1.text;