T
thomasamillergoogle
I have a simple problem I have a user control that I added to a main
form.
When I click a button in the user control I want to change the text of
a label that is in the main form.
This is the code in the user control:
private void button1_Click(object sender, System.EventArgs e)
{
Form1.ChangeIt();
}
this is the code in the main Form:
public static void ChangeIt()
{
//??????????????
//how to make this work using a static method?
this.label1.Text = "Clicked!!";
//??????????????
}
form.
When I click a button in the user control I want to change the text of
a label that is in the main form.
This is the code in the user control:
private void button1_Click(object sender, System.EventArgs e)
{
Form1.ChangeIt();
}
this is the code in the main Form:
public static void ChangeIt()
{
//??????????????
//how to make this work using a static method?
this.label1.Text = "Clicked!!";
//??????????????
}