anonymous No title
No License C#
2020年09月16日
Copy
public static void Main(){
        const float beginX = 800;//開始X座標
        const float endX = 340;//終了X座標
        const float rate = 0.01f;//移動量の係数(0fに近いほど遅く1fに近づくほど速い)
        float x = 0f;
        pictureBox1.Left = (int) beginX;
        while (Math.Abs(beginX - x - endX) >= 1) {
        	pictureBox1.Left = (int) (beginX - x);
        	x += (beginX - endX) * rate;
        	pictureBox1.Refresh();
        	wait();
        }
        pictureBox1.Left = (int) endX;
    }
    
    private static async void wait() {
        await Task.Delay(16);//60FPS(16ms)で再描画
    } 
public static void Main(){
        const float beginX = 800;//開始X座標
        const float endX = 340;//終了X座標
        const float rate = 0.01f;//移動量の係数(0fに近いほど遅く1fに近づくほど速い)
        float x = 0f;
        pictureBox1.Left = (int) beginX;
        while (Math.Abs(beginX - x - endX) >= 1) {
        	pictureBox1.Left = (int) (beginX - x);
        	x += (beginX - endX) * rate;
        	pictureBox1.Refresh();
        	wait();
        }
        pictureBox1.Left = (int) endX;
    }
    
    private static async void wait() {
        await Task.Delay(16);//60FPS(16ms)で再描画
    } 

No one still commented. Please first comment.