namespace play_stop
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button4_Click(object sender, EventArgs e)
{
timer1.Interval = 1000;
timer1.Start();
Counter = 0;
}
public void circles()
{
Graphics g = panel1.CreateGraphics();
g.DrawEllipse(
new Pen(Color.Red),panel1.Width / 2, panel1.Height / 2,75, 75);
Graphics h = panel1.CreateGraphics();
h.DrawEllipse(
new Pen(Color.Blue),
panel1.Width / 2, panel1.Height / 2, 50, 50);
Graphics j = panel1.CreateGraphics();
j.DrawEllipse(
new Pen(Color.Yellow),
panel1.Width / 2, panel1.Height / 2, 80,80);
Graphics k = panel1.CreateGraphics();
k.DrawEllipse(
new Pen(Color.Green),
panel1.Width / 2, panel1.Height / 2, 100,100);
}
public int counter;
public int Counter
{
get { return counter; }
set { counter = value; }
}
private void timer1_Tick(object sender, EventArgs e)
{
Counter++;
while ( counter < 5 )
{
circles();
}
}
}
}
sunil5 0 Newbie Poster
sunil5 0 Newbie Poster
AleMonteiro 238 Can I pick my title?
ddanbe 2,724 Professional Procrastinator Featured Poster
sunil5 0 Newbie Poster
sunil5 0 Newbie Poster
Momerath 1,327 Nearly a Senior Poster Featured Poster
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.