Code
1 public partial class Form1 : Form
2 {
3 public Form1()
4 {
5 InitializeComponent();
6 }
7
8 private double i = 0;
9 private double j = 30;
10 private double ii = 60;
11 private double jj = 90;
12 private Point point_1;
13 private Point point_2;
14 private Point point_3;
15 private Point point_4;
16
17 private void timer1_Tick(object sender, EventArgs e)
18 {
19 this.point_1 = new Point(
20 (int)(100 * Math.Sin(i) + 143), (int)(100 * Math.Cos(i)) + 167);
21 this.panel1.Location = this.point_1;
22
23 this.point_2 = new Point(
24 (int)(100 * Math.Sin(j) + 143), (int)(100 * Math.Cos(j)) + 167);
25 this.panel2.Location = this.point_2;
26
27 this.point_3 = new Point(
28 (int)(100 * Math.Sin(ii) + 143), (int)(100 * Math.Cos(ii)) + 167);
29 this.panel3.Location = this.point_3;
30
31 this.point_4 = new Point(
32 (int)(100 * Math.Sin(jj) + 143), (int)(100 * Math.Cos(jj)) + 167);
33 this.panel4.Location = this.point_4;
34
35 j += 0.05;
36 ii += 0.05;
37 jj += 0.05;
38 i += 0.05;
39 }
40
41 private void button1_MouseMove(object sender, MouseEventArgs e)
42 {
43 this.timer1.Stop();
44 }
45
46 private void button1_MouseLeave(object sender, EventArgs e)
47 {
48 this.timer1.Start();
49 }
50
51 private void button1_Click(object sender, EventArgs e)
52 {
53
54 }
55 }
1 public partial class Form1 : Form
2 {
3 public Form1()
4 {
5 InitializeComponent();
6 }
7
8 private double i = 0;
9 private double j = 30;
10 private double ii = 60;
11 private double jj = 90;
12 private Point point_1;
13 private Point point_2;
14 private Point point_3;
15 private Point point_4;
16
17 private void timer1_Tick(object sender, EventArgs e)
18 {
19 this.point_1 = new Point(
20 (int)(100 * Math.Sin(i) + 143), (int)(100 * Math.Cos(i)) + 167);
21 this.panel1.Location = this.point_1;
22
23 this.point_2 = new Point(
24 (int)(100 * Math.Sin(j) + 143), (int)(100 * Math.Cos(j)) + 167);
25 this.panel2.Location = this.point_2;
26
27 this.point_3 = new Point(
28 (int)(100 * Math.Sin(ii) + 143), (int)(100 * Math.Cos(ii)) + 167);
29 this.panel3.Location = this.point_3;
30
31 this.point_4 = new Point(
32 (int)(100 * Math.Sin(jj) + 143), (int)(100 * Math.Cos(jj)) + 167);
33 this.panel4.Location = this.point_4;
34
35 j += 0.05;
36 ii += 0.05;
37 jj += 0.05;
38 i += 0.05;
39 }
40
41 private void button1_MouseMove(object sender, MouseEventArgs e)
42 {
43 this.timer1.Stop();
44 }
45
46 private void button1_MouseLeave(object sender, EventArgs e)
47 {
48 this.timer1.Start();
49 }
50
51 private void button1_Click(object sender, EventArgs e)
52 {
53
54 }
55 }