I was making a button move by the click of it, and heres my code:
button1.location = new Point(new Random().Next(10, 385), new Random().Next(10, 385));
But that only seems to move the button in a diagonal line. Please help. Thanks
I was making a button move by the click of it, and heres my code:
button1.location = new Point(new Random().Next(10, 385), new Random().Next(10, 385));
But that only seems to move the button in a diagonal line. Please help. Thanks
Two Randoms created in a very short time (like in your code) will return a deterministic value. This is because in that time the seed values will not differ.
You should create a Random before and reuse it:
var random = new Random();
button1.location = new Point(random.Next(10, 385), random.Next(10, 385));