Dear Friends!
I want to draw a bouncing ball directly on form using component timer.
I think that I should draw a ball then change its coordinates. Like this:
public partial class FormMain : Form
{ int mx = 10;
int my = 10;
public FormMain()
{
InitializeComponent();
}
private void timer_Tick(object sender, EventArgs e)
{
System.Drawing.Graphics graphicsObj;
graphicsObj = this.CreateGraphics();
Pen myPen = new Pen(System.Drawing.Color.Green, 5);
mx += 10; my += 10;
Rectangle myRectangle = new Rectangle(mx, my, 10, 10);
//graphicsObj.DrawEllipse(myPen, myRectangle);
graphicsObj.FillEllipse(new SolidBrush(Color.Blue), myRectangle);
}
}
It's working incorrectly so I really need your help.
Thanks in advanced for any suggestion.