公共变量的复值
public static int cont=5;
这个是在程序的窗体的form load事件里面的
private void time()
{
dt.Elapsed += new System.Timers.ElapsedEventHandler(OnTimed);
//set the enable interval
dt.Interval=cont * 1000;
dt.Enabled=true;
dt.Start();
}
然后另一个窗体进行传值
private void button1_Click(object sender, System.EventArgs e)
{
int i=Convert.ToInt32(comboBox1.Text);
Form1.cont=i;
Form2 fr=new Form2();
fr.Dispose();
}结果没有错误
可是好像cont值改变后没有影响
请问怎么办