private void button1_Click(object sender, EventArgs e) { if (gra1 == null) { gra1 = new CHistGraph(groupBox1, 260, 0); gra2 = new CSpeedGraph(groupBox2,260,-1); gra2.Driver = graph2; gra1.Driver = graph1; gra1.TitleX = "Velocity (kph)"; gra1.TitleY = "Time (t)"; gra2.GraphEnabled = true; gra1.GraphEnabled = true; gra3 = new CHistGraph(groupBox3, 260, 0); gra4 = new CSpeedGraph(groupBox4, 260, -1); gra4.Driver = graph4; gra3.Driver = graph3; gra3.TitleX = "Velocity (kph)"; gra3.TitleY = "Time (t)"; gra4.GraphEnabled = true; gra3.GraphEnabled = true; timer1.Enabled = true; timer2.Enabled = true; button1.Text = "&Stop Demo"; } else if (timer1.Enabled == true) { timer1.Enabled = false; button1.Text = "&Start Demo"; } else { timer1.Enabled = true; button1.Text = "&Stop Demo"; } }
private void button1_Click(object sender, EventArgs e) { if (gra1 == null) { gra1 = new CHistGraph(groupBox1, 260, 0); gra2 = new CSpeedGraph(groupBox2, 260, -1); gra2.Driver = graph2; gra1.Driver = graph1; gra1.TitleX = "Velocity (kph)"; gra1.TitleY = "Time (t)"; gra2.GraphEnabled = true; gra1.GraphEnabled = true; gra3 = new CHistGraph(groupBox3, 260, 0); gra4 = new CSpeedGraph(groupBox4, 260, -1); gra4.Driver = graph4; gra3.Driver = graph3; gra3.TitleX = "Velocity (kph)"; gra3.TitleY = "Time (t)"; gra4.GraphEnabled = true; gra3.GraphEnabled = true; timer1.Enabled = true; timer2.Enabled = true; button1.Text = "&Stop Demo"; } else if (timer1.Enabled == true) { timer1.Enabled = false; button1.Text = "&Start Demo"; } else { timer1.Enabled = true; button1.Text = "&Stop Demo"; } }