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.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.