Answers for "Animate picturebox c# winforms"

C#
0

Animate picturebox c# winforms

public partial class myForm : Form
{
    void myTimer_Tick(object sender, EventArgs e)
    {
        int x = myPictureBox.Location.X;
        int y = myPictureBox1.Location.Y;

    myPictureBox.Location = new Point(x+25, y);

    if (x > this.Width)
        myTimer.Stop();
}

public myForm()
{
    InitializeComponent();

    myTimer.Interval = 10;
    myTimer.Tick += new EventHandler(myTimer_Tick);
}

private void myButton_Click(object sender, EventArgs e)
{
    myPictureBox.Show();
    myTimer.Start();
}
Posted by: Guest on August-22-2021

Code answers related to "Animate picturebox c# winforms"

C# Answers by Framework

Browse Popular Code Answers by Language