using System;
System.Windows.Forms;
namespace Iran_eng
{
publicpartialclassForm2 : Form
{
public Form2()
{
InitializeComponent();
}
Graphics g;
Pen p = newPen(Brushes.Yellow, 3);
int x1 = 150, x2=150, y1 =100, y2=150;
privatevoid Form2_Load(object sender, EventArgs e)
{
g = this.CreateGraphics();
}
privatevoid Form2_Paint(object sender, PaintEventArgs e)
{
g.FillEllipse(Brushes.Blue, 100, 100, 100, 100);
g.DrawLine(p, x1, y1, x2, y2);
}
privatevoid timer1_Tick(object sender, EventArgs e)
{
g.DrawLine(newPen(Color.Blue, 3), x1, y1, x2, y2);
if (y1 <= 150 && x1 <= 150)
{
x1 -= 8;
y1 += 10;
}
elseif (y1 > 150 && y1 < 270 && x1 < 150)
{
x1 += 8;
y1 += 5;
}
elseif (y1 <= 270 && y1>=150 && x1 >= 150 && x1<=270)
{
x1 += 10;
y1 -= 10;
}
else
{
x1 -= 5;
y1 -= 5;
if (y1 == 100 )
{
timer1.Enabled = false;
}
}
g.DrawLine(p, x1, y1, x2, y2);
}
}
}
يه كم اعدادش مشكل داره!ديگه بيشتر از اين وقت نداشتم. به زبان C# نوشتم.اميدوارم بدردت بخوره.