I am programming a cards game, when i was doing the visual part i had a problem with moving the card within a panel from one place to another, the image keeps blinks and moves every where when i try to move it.
This is my code.....
public partial class Form1 : Form
{
bool clicked = false;
public Form1()
{
InitializeComponent();
pictureBox1.ImageLocation = @"c:\kingHearts.png";
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
}
private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
{
clicked = true;
}
private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
{
if (clicked)
pictureBox1.Location = e.Location;
}
private void pictureBox1_MouseUp(object sender, MouseEventArgs e)
{
clicked = false;
}
}
So what is wrong, anyone can help plz....