private void Dang(object obj) { while (!isClose) { if (help.IsOn == false) { help = new ES(60, Width); help.Dangerous(); } else { if (help.X - 50 > 0) { help.Move(); BeginInvoke(new MyDelegate(Refresh)); } else { help.IsOn = false; } } Thread.Sleep(1000); } }
public MainForm() { InitializeComponent(); tl1 = new TrafficLight(); au1 = new Auto(80, Width); ped1 = new Pedestrian(40, Height); help = new ES(60, Width); }