Beispiel #1
0
 private void train1_DistanceChanged(object sender, DistanceChangedEventArgs e)
 {
     train1.Left = track1.Left + e.Distance;
     if (train1.Right >= track1.Right)
     {
         train1.Speed = 0;
     }
 }
Beispiel #2
0
        private void train3_DistanceChanged(object sender, DistanceChangedEventArgs e)
        {
            train3.Left = track2.Left + e.Distance;

            // Fire on Train
            Fire_On_Train();

            if (train3.Right >= track2.Right)
            {
                train3.Speed   = 0;
                throttle.Value = 0;
                MessageBox.Show("You win");
            }
        }