怎么设置当点击鼠标左键时,窗体缩小10%吗,点击右键,窗体放大10%。
if (e.Button = MouseButtons.Left)
            {
                
然后怎么写啊?
求解答,

解决方案 »

  1.   

    缩小
    this.width=this.width*0.9
    this.height=this.height*0.9
    增长this.width=this.width*1.1
    this.height=this.height*1.1
      

  2.   

    我自己解决了            if (e.Button == MouseButtons.Left)
                {
                    
                    this.Width = this.Width * 9/10;
                    this.Height = this.Height *  9/10;
                }
                if (e.Button == MouseButtons.Right)
                {
                    this.Width = this.Width * 11/10;
                    this.Height = this.Height * 11/10;
                }
    谢谢大家
      

  3.   

    如果是固定10%时。
    load的时候把长宽存起来
    _w=this.width*0.1;
    _h=this.height*0.1;Left时
    this.width -= _w;
    this.height -= _h;right时
    this.width += _w;
    this.height += _h;如果想每次都放大、缩小 10%
    this.width = this.width*0.9;
    this.height = this.height*0.9;this.width=this.width*1.1
    this.height=this.height*1.1