|
|
@@ -180,9 +180,17 @@ namespace UAS_MES.Query
|
|
|
Param.Text = j + " " + Step[j];
|
|
|
Param.Name = j + Step[j] + "_label";
|
|
|
Param.AutoSize = true;
|
|
|
+ Param.Margin = new Padding(0,0,0,0);
|
|
|
Param.Anchor = AnchorStyles.Left;
|
|
|
Param.Anchor = AnchorStyles.Top;
|
|
|
- Param.Location = new Point(x + r.Width / 14 * RectangleCountEachRow, y + r.Height / 10 * 4);
|
|
|
+ //获取param的宽度和高度
|
|
|
+ Graphics graphics = Graphics.FromHwnd(Param.Handle);
|
|
|
+ SizeF size = graphics.MeasureString(Param.Text,Param.Font);
|
|
|
+
|
|
|
+ //设定param文本框的位置
|
|
|
+ //Param.Location = new Point(x + r.Width / 14 * RectangleCountEachRow, y + r.Height / 10 * 4);
|
|
|
+ Param.Location = new Point(x+(int)(r.Width-size.Width)/2,y+(int)(r.Height-size.Height)/2);
|
|
|
+ graphics.Dispose();
|
|
|
//如果在奇数行
|
|
|
if (i % 2 != 0)
|
|
|
{
|