代码清理
This commit is contained in:
@ -1,18 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AntdUI;
|
||||
|
||||
namespace DHSoftware.Utils
|
||||
namespace DHSoftware.Utils
|
||||
{
|
||||
public static class AdaptiveHelper
|
||||
{
|
||||
#region 控件大小随窗体大小等比例缩放
|
||||
|
||||
|
||||
|
||||
public static void setTag(Control cons)
|
||||
{
|
||||
foreach (Control con in cons.Controls)
|
||||
@ -35,15 +26,13 @@ namespace DHSoftware.Utils
|
||||
con.Height = Convert.ToInt32(Convert.ToSingle(mytag[1]) * newy); //高度
|
||||
con.Left = Convert.ToInt32(Convert.ToSingle(mytag[2]) * newx); //左边距
|
||||
con.Top = Convert.ToInt32(Convert.ToSingle(mytag[3]) * newy); //顶边距
|
||||
var currentSize = Convert.ToSingle(mytag[4]) * newy; //字体大小
|
||||
var currentSize = Convert.ToSingle(mytag[4]) * newy; //字体大小
|
||||
if (currentSize > 0) con.Font = new Font(con.Font.Name, currentSize, con.Font.Style, con.Font.Unit);
|
||||
con.Focus();
|
||||
if (con.Controls.Count > 0) setControls(newx, newy, con);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
#endregion 控件大小随窗体大小等比例缩放
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user