I want to pass my Label I use in my mainForm to an anonymous form. By anonymous form I mean this form count can be infinite. I will show my code to make it clear.
This is my second form.
LABEL sourceObj;
public frmCounters(string text, ref LABEL _sourceObj)
{
InitializeComponent();
sourceObj = _sourceObj;
this.Text = text;
this.lblInfo.Text = text;
this.lblTime = sourceObj;
}
and this is how I call it
AnonymForm afrm = new AnonymForm("TEST1", ref lblTEST1);
afrm.Show();
all I want to achieve here is update anonyform's label whenever I change the source from my main form. I have tried with and without ref keyword in constructor. I've bind the value I get in constructor to another variable I hold in anonymform. I also wanted to try send text property as reference but Visual Studio said I can't pass properties with ref keyword.
My question is how can I achieve that?