我在窗体的Resize事件中重新调整了窗体内控件的位置
明显感觉出窗体Resize时,窗体内空间的位置的移动。说白了就是有点慢~
我的机器是P42.0 512内存~~配置不高~~但我想也不至于这样吧~还是我的写法有问题~?
private void Frm_XS_Add_Resize(object sender, EventArgs e)
{
this.Height = this.Parent.Height - 25;
this.Width = this.Parent.Width - 10;
Lab_BT.Left = this.Width / 2 - Lab_BT.Width / 2;
Lab_FGX1.Width = this.Width-5;
groupBox1.Left = groupBox2.Left = this.Width / 2 - groupBox1.Width / 2;
Lab_TBDW.Left = Lab_TBR.Left = groupBox1.Left;
Txt_TBDW.Left = Lab_TBDW.Left + Lab_TBDW.Width + 5;
Txt_TBR.Left = Lab_TBR.Left + Lab_TBR.Width + 5;
DateP_TBSJ.Left = groupBox1.Left + groupBox1.Width - DateP_TBSJ.Width;
Txt_SHR.Left = groupBox1.Left + groupBox1.Width - Txt_SHR.Width;
Lab_TBSJ.Left = DateP_TBSJ.Left - Lab_TBSJ.Width - 5;
Lab_SHR.Left = Txt_SHR.Left - Lab_SHR.Width - 5;
}
明显感觉出窗体Resize时,窗体内空间的位置的移动。说白了就是有点慢~
我的机器是P42.0 512内存~~配置不高~~但我想也不至于这样吧~还是我的写法有问题~?
private void Frm_XS_Add_Resize(object sender, EventArgs e)
{
this.Height = this.Parent.Height - 25;
this.Width = this.Parent.Width - 10;
Lab_BT.Left = this.Width / 2 - Lab_BT.Width / 2;
Lab_FGX1.Width = this.Width-5;
groupBox1.Left = groupBox2.Left = this.Width / 2 - groupBox1.Width / 2;
Lab_TBDW.Left = Lab_TBR.Left = groupBox1.Left;
Txt_TBDW.Left = Lab_TBDW.Left + Lab_TBDW.Width + 5;
Txt_TBR.Left = Lab_TBR.Left + Lab_TBR.Width + 5;
DateP_TBSJ.Left = groupBox1.Left + groupBox1.Width - DateP_TBSJ.Width;
Txt_SHR.Left = groupBox1.Left + groupBox1.Width - Txt_SHR.Width;
Lab_TBSJ.Left = DateP_TBSJ.Left - Lab_TBSJ.Width - 5;
Lab_SHR.Left = Txt_SHR.Left - Lab_SHR.Width - 5;
}
http://www.microsoft.com/china/msdn/library/architecture/architecture/architecturetopic/SCArchDeGuide/Chapter8SCAppPerf.mspx?mfr=true