一、 以lable为例:
在Form中放一个控件,让其在启动和动态改变窗口大小时始终居中
int gLeft = this.Width / 2 - lable1.Width / 2; //this指Form
int gTop = this.Height / 2 - lable1.Height / 2;
lable1.Location = new Point(gLeft, gTop);
二、动态创建控件并找到或者删除控件
1、 以Lable为例创建控件:
Label lbl = new Label();
lbl.Name = "lblNum" + m;
lbl.AutoSize = true;
lbl.BackColor &