如何将一个整数数组从一个按钮传递到另一个按钮?将数组从一个按钮传递到另一个按钮
下面是详细信息(下面的代码是不完全的我原来的代码,但它说明了我在问什么):
private void button1_Click(object sender, EventArgs e)
{
int[,] array1 = new int[pictureBox1.Height, pictureBox1.Width];
int[,] array2 = new int[pictureBox1.Height, pictureBox1.Width];
array2 = binary(array1);//binary is a function
}
private void button2_Click(object sender, EventArgs e)
{
//I need array2 here
}
现在我想在BUTTON2访问数组2。我怎样才能做到这一点?什么是最好的解决方案?
在此先感谢。
看看http://en.wikipedia.org/wiki/Magic_pushbutton –