2
Answers

changing a colour of circlwe based on timer

spencer20012

spencer20012

20y
1.9k
1
hi, i have a timer and an onpaint method see below. i need to change the colour of the circles after 10- seconds how do i do this? private void Form1_Load(object sender, System.EventArgs e) { //northSensor = new TrafficSensor(north); //southSensor = new TrafficSensor(south); counter = 0; timer1.Interval = 1000; timer1.Enabled = true; // Hook up timer's tick event handler. this.timer1.Tick += new System.EventHandler(this.timer1_Tick); } private void OnPaint(object sender,System.Windows.Forms.PaintEventArgs e) { Brush bru=new SolidBrush(Color.Blue); //lights at top g.FillEllipse(bru, 394, 54, 30, 30); g.FillEllipse(bru, 425, 54, 30, 30); g.FillEllipse(bru, 456, 54, 30, 30); }
Answers (2)