Random plaats = new Random();
btnStart.Content = "Stop";
Roadrunner.Margin = new Thickness(Left,50,0,0);
_timer.Start();
this is my code
Random plaats = new Random();
btnStart.Content = "Stop";
Roadrunner.Margin = new Thickness(Left,50,0,0);
_timer.Start();
this is my code
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jefferson S. MottaPosted Jan 26, 2023, 4:11 PM
Random plaats = new Random();
int x = plaats.Next(0, this.grid1.Size.Width - Roadrunner.Size.Width);
int y = plaats.Next(0, this.grid1.Size.Height - Roadrunner.Size.Height);
Roadrunner.Location = new Point(x, y);