Since you haven't posted your code, I cannot tell why it's not working. But what you want is easily done.
public class FormA : Form
{
// ...
public string Label1Value
{
get { return this.label1.Text; }
set { this.label1.Text = value; }
}
// ...
}
And you can easily use it in any other form or code (except when it's in another thread.)
public class FormB : Form
{
private void Button1_Click(object sender, MouseEventArgs e)
{
formA.Label1Value = "FormB was clicked";
}
}
Update
If you want to use events like Davide suggested, you could do something like this.
public class EULAEventArgs : EventArgs
{
public string Signature { get; set; }
}
public class FormB : Form
{
public event EventHandler<EULAEventArgs> EULAAccepted;
protected virtual void OnEULAAccepted(EULAEventArgs e)
{
if (EULAAccepted != null)
EULAAccepted(this, e);
}
public void Button1_Clicked(...)
{
OnEULAAccepted(new EULAEventArgs { Signature = "..." });
}
}
public class FormA : Form
{
public FormA()
{
// ...
formB.EULAAccepted += EULAAccepted;
}
private void EULAAccepted(object sender, EULAEventArgs e)
{
this.label1.Text = String.Format("Thank you {0} for accepting the EULA.",
e.Signature);
}
}