This is my code. When I move cursor over Form it works, circle is moving but it is blinking. How can I fix this?
public partial class Preprocesor : Form
{
int x, y;
Graphics g;
public Preprocesor()
{
InitializeComponent();
}
private void Preprocesor_Load(object sender, EventArgs e)
{
g = pnlMesh.CreateGraphics();
}
private void pnlMesh_Paint(object sender, PaintEventArgs e)
{
g.Clear(Color.White);
g.FillEllipse(Brushes.Black, x, y, 10, 10);
}
private void pnlMesh_MouseMove(object sender, MouseEventArgs e)
{
x = e.X;
y = e.Y;
pnlMesh.Invalidate();
}
}