winform窗体自适应大小,运行环境:Visual Studio 2017,.Net Framework 4.8;
用法简单,调用AutoSize 即可。
private static AutoSize autoSize;
public Form1()
{
InitializeComponent();
autoSize = new AutoSize();
}
private void Form1_Load(object sender, EventArgs e)
{
autoSize.controllInitializeSize(this);
}
private void Form1_SizeChanged(object sender, EventArgs e)
{
autoSize.controlAutoSize(this);
}
1