编程论坛's Archiver

coolszy 发表于 2008-6-3 23:00

关于窗体最大化

我做了一个程序,当我点击最大化时,那些控件没有随之变大,请问该如何设置。

coolszy 发表于 2008-6-4 21:32

大家帮我看一下子吧

guoxhvip 发表于 2008-6-4 23:08

比如说一个窗体上有一个textBox
private void Form1_Load(object sender, System.EventArgs e)
{
   this.oldHeight = this.Height - this.textBox1.Height ;
   this.oldWidth = this.Width - this.textBox1.Width ;
   this.oldLocation = this.textBox1.Location ;
}
private void Form1_Resize(object sender, System.EventArgs e)
{
   this.textBox1.Height = (this.Height - this.oldWidth) ;
   this.textBox1.Width = (this.Width - this.oldWidth) ;
   this.textBox1.Location = new Point(this.oldLocation.X,this.oldLocation.Y);
}

ZHOULIANG 发表于 2008-6-5 13:45

原来如此啊
谢谢了

coolszy 发表于 2008-6-5 17:30

谢谢了[tk01]

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.