TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Andrija Jovanovic
NA
1
1.4k
Help with concentric circles
Dec 16 2015 3:03 PM
Hello, so i need help. I'm a total newbie and i need help to delete every previous circle when the new one pops up.
The program down below creates concentric circles only, and i don't know how to "recreate" it(soz, english is not my main language)
Thanks in advance.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int x, y, R, d, br, pR;
Random r = new Random();
Pen olovka = new Pen(Color.Red, 5);
private void timer1_Tick(object sender, EventArgs e)
{
br++;
Graphics g = CreateGraphics();
g.DrawEllipse(olovka, x - R, y - R, 2 * R, 2 * R);
R += pR;
pR += 5;
timer1.Interval += 200;
if (br % 2 == 0) d--;
olovka.Width = d;
if (d == 0)
timer1.Enabled = false;
}
private void Form1_MouseDown(object sender, MouseEventArgs e)
{
x=e.X;
y=e.Y;
R=5;
d=5;
pR=1;
olovka.Width=d;
timer1.Enabled=true;
timer1.Interval=1;
Refresh();
br=0;
}
}
}
Reply
Answers (
0
)
C# VS sql project error
cross threading seting form controls