试了几个网上的,WINFORM按比例缩放的,都不行,一放大,就全乱了

解决方案 »

  1.   

    重载 OnSize 方法,在里面根据比例调整大小
      

  2.   

    使用 TableLayoutPanel  控件,设置Columns,宽度都以百分比设置就可以了。
      

  3.   

    一楼上源码啊,我试几个都不行
    private void Form1_ResizeEnd(object sender, EventArgs e)
            {
                this.panel1.Size = new Size(this.panel1.Parent.Size.Width / 2, this.panel1.Parent.Size.Height);
                this.panel2.Location = new Point(this.panel1.Location.X + this.panel1.Size.Width, this.panel1.Location.Y);
                this.panel2.Size = new Size(this.panel1.Parent.Size.Width / 2, this.panel1.Parent.Size.Height/2);
                this.panel2.Location = new Point(this.panel1.Location.X + this.panel1.Size.Width, this.panel2.Location.Y+this.panel1.Parent.Height+this.panel2.Size.Height);
                this.panel3.Size = new Size(this.panel1.Parent.Size.Width / 2, this.panel1.Parent.Size.Height/2);
             }
    这样可以,但是最大化最小化的时候无反应
      

  4.   

    Form1_Resize事件改为这个就可以了!解决!