0

I tried to create 10 random circles with random colors using windows forms.

The problem am not able to restrict my program to draw only 10 circles.It goes on and on.

Timer t = new Timer();
t.Interval = 1;
t.Start();
t.Tick += new EventHandler(DrawCircle);

is there any way to stop the timer after 10 counts?
So that i will call
t.stop(); after drawing 10 circles.

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by ddanbe
1

You could introduce an extra counter variable. Increase it in your Tick event handler and call Stop when it reaches 10.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.