/// <summary> /// If the animation is in "up-phase" then every tick the picture Y-Cordinate -= 1 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ToStartAnimation_Tick(object sender, EventArgs e) { if (this.pictureBox1.Location.Y > y) { pictureBox1.Location = new Point(pictureBox1.Location.X, pictureBox1.Location.Y - 1); } else { ToStartAnimation.Stop(); ToEndAnimation.Start(); } }
/// <summary> /// This method stops the animation /// </summary> private void stopAnimation() { ToEndAnimation.Stop(); ToStartAnimation.Stop(); this.pictureBox1.Location = new Point(pictureBox1.Location.X, y); }