So, I have two forms -- one that is open, and another that is essentially just a popup on the second one. The second form opens with a maskedtextbox inside it, plus Save and Cancel buttons -- I want Save to change a field on the first form.
As far as I know, I have to use a second form for my popup since what I want to accomplish isn't as simple as something I could put in a MessageBox -- if there is another option, I'm all ears.
What I've been trying:
Form 1:
public partial class Form1 : Form
{
public void ChangeLabel()
{
label1.Text = StaticVariables.labelString;
}
}
Form 2:
public partial class Form2 : Form
{
private void changeForm1_Click(object sender, EventArgs e)
{
StaticVariables.labelString = textBox.Text;
Form1 frm = new Form1();
frm.ChangeLabel();
}
}
Obviously, that hasn't worked.