Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

Access,reasign,bail

Mar 2, 2007 9:33AM PST

--Anyone know how to access the m string from another button event?

private void button1_CheckedChanged(object sender, EventArgs e)
{
m = "Convertible";
}
private void button2_Click(object sender, EventArgs e)
{
string m = "Truck";
MessageBox.Show(string.Concat(m, " is your car now."), MessageBoxButtons.OK);
}

Discussion is locked