C# WinForm PictureBox的鼠标滑轮MouseWheel事件

public Form1() 

    InitializeComponent(); 
    this.pictureBox1.MouseWheel += new MouseEventHandler(PictureBox1_MouseWheel); 
} private void PictureBox1_MouseDown(object sender, MouseEventArgs e) 

    this.pictureBox1.Focus(); 
} private void PictureBox1_MouseWheel(object sender, System.Windows.Forms.MouseEventArgs e) 

    if (e.Delta > 0)
    {
        this.Text = "Mouse Wheeled Up";
    }
    else
    {
        this.Text = "Mouse Wheeled Down";
    }
}

你可能感兴趣的:(C# WinForm PictureBox的鼠标滑轮MouseWheel事件)