P
Pablo Czyscas
Hi, my question is how to update tha value in a labe (label1)l when i click
in a button ( button1 or button2 ), like this code:
public partial class Form1 : Form
{
private static string variable;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
label1.Text = variable;
}
private void button1_Click(object sender, EventArgs e)
{
variable = "a";
}
private void button2_Click(object sender, EventArgs e)
{
variable = "b";
}
private void button3_Click(object sender, EventArgs e)
{
MessageBox.Show(variable);
}
}
thanks a lot!
Pablo
in a button ( button1 or button2 ), like this code:
public partial class Form1 : Form
{
private static string variable;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
label1.Text = variable;
}
private void button1_Click(object sender, EventArgs e)
{
variable = "a";
}
private void button2_Click(object sender, EventArgs e)
{
variable = "b";
}
private void button3_Click(object sender, EventArgs e)
{
MessageBox.Show(variable);
}
}
thanks a lot!
Pablo