如题,最好能提供源码,高手们请进!

解决方案 »

  1.   


    picturebox Drawing ;
    添加   private void Drawing_MouseWheel(object sender, MouseEventArgs e)
    {
    double scale = 1;
                if (Drawing.Height > 0)
                {
                    scale = (double)Drawing.Width / (double)Drawing.Height;
                }
                if ((Drawing.Width > 200) && (e.Delta < 0))
                {
                    Drawing.Width += (int)(e.Delta * scale);
                    Drawing.Height += e.Delta;
                   
                }
                else if ((Drawing.Width < 1080) && (e.Delta>0))
                {
                    Drawing.Width += (int)(e.Delta * scale);
                    Drawing.Height += e.Delta;            }
    }
      

  2.   

    private void Drawing_MouseWheel(object sender, MouseEventArgs e) 

    double scale = 1; 
                if (Drawing.Height > 0) 
                { 
                    scale = (double)Drawing.Width / (double)Drawing.Height; 
                } 
                if ((Drawing.Width > 200) && (e.Delta < 0)) 
                { 
                    Drawing.Width += (int)(e.Delta * scale); 
                    Drawing.Height += e.Delta; 
                  
                } 
                else if ((Drawing.Width < 1080) && (e.Delta>0)) 
                { 
                    Drawing.Width += (int)(e.Delta * scale); 
                    Drawing.Height += e.Delta;             } 
    }
      

  3.   

    MouseWheel 怎么没有看到,我是VS2005
      

  4.   


                pictureBox1.Location = new Point(pictureBox1.Location.X - 5, pictureBox1.Location.Y - 5);
                pictureBox1.Size = new Size(pictureBox1.Size.Width + 5, pictureBox1.Size.Height + 5);写到某个事件中估计能用吧
      

  5.   

    MouseWheel事件好象屏蔽了,即使写出来,怎么好象也没用呢
      

  6.   

    this.Drawing.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.Drawing_MouseWheel);
    自己添加,VS2005
      

  7.   

    托一个contextMenuStrip 空件,连到pictureBox的contextMenuStrip属性。  private void zoomInToolStripMenuItem_Click(object sender, EventArgs e)
            {
               int h = pictureBox1.Height;
               int w= pictureBox1.Width ;
               h = h * 2; w = w * 2;
               pictureBox1.Height = h;
               pictureBox1.Width = w;
            }