日期:2014-05-18 浏览次数:20842 次
public class MyPictureBoxWheel : PictureBox { public event MouseEventHandler MouseWheel; protected override void OnMouseWheel(MouseEventArgs e) { base.OnMouseWheel(e); if (MouseWheel != null) MouseWheel(this, e); } }
------解决方案--------------------
http://download.csdn.net/source/2701596
应该对你有帮助
------解决方案--------------------
//鼠标滚轮事件 void pictureBox1_MouseWheel(object sender, System.Windows.Forms.MouseEventArgs e) { Size t = pictureBox1.Size; if (e.Delta == -120) { pictureBox1.Size = new Size(t.Width - 120, t.Height - 120); } else if (e.Delta == 120) { pictureBox1.Size = new Size(t.Width + 120, t.Height + 120); } }