在.....Designer.cs中加入

            this.pictureBox1.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseWheel); 

再加入事件

 void pictureBox1_MouseWheel(object sender, MouseEventArgs e) 
        {   double scale = 1; 
            if (pictureBox1.Height > 0)
            {
                scale = (double)pictureBox1.Width / (double)pictureBox1.Height;
            }
            pictureBox1.Width += (int)(e.Delta * scale);
            pictureBox1.Height += e.Delta;
        }

 

相关文章:

  • 2021-10-10
  • 2021-07-29
  • 2021-07-06
  • 2021-08-05
  • 2022-12-23
  • 2021-12-04
  • 2021-04-22
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-17
  • 2021-11-10
  • 2021-11-05
  • 2021-11-27
  • 2021-06-12
相关资源
相似解决方案