I have some pictureboxes in the form in a List. I want them to update their position and still being able to drag the object while updating the others.
I'm doing and infinitive while loop the keep updating their positions:
while (true)
{
Random rnd = new Random();
pictures[0].Location = new Point(pictures[0].Location.X - rnd.Next(-2, 3), pictures[0].Location.Y + rnd.Next(0, 2));
pictures[1].Location = new Point(pictures[1].Location.X, pictures[1].Location.Y + 1);
this.Update();
}
The problem is that I've made this elements draggable, but the MouseDown event is not being called. Because of the infinity loop I guess, but how can I fix that ?