Skip to content

Commit

Permalink
publish 1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
hlz2516 committed Sep 10, 2023
1 parent 201502f commit 126c873
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
9 changes: 6 additions & 3 deletions AutoScaleHelper/AutoScale.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void SetContainer(Control container)
{
continue;
}
if (ctrl.Parent is DataGridView || ctrl.Parent is UpDownBase || ctrl.Parent is TableLayoutPanel)
if (ctrl.Parent is DataGridView || ctrl.Parent is UpDownBase)
{
continue;
}
Expand Down Expand Up @@ -152,7 +152,7 @@ public void UpdateControlsLayout(bool recursive = true)
{
continue;
}
if (ctrl.Parent is DataGridView || ctrl.Parent is UpDownBase || ctrl.Parent is TableLayoutPanel)
if (ctrl.Parent is DataGridView || ctrl.Parent is UpDownBase)
{
continue;
}
Expand Down Expand Up @@ -349,7 +349,10 @@ public void AddControl(Control ctrl, NoScaleMode noScaleMode = NoScaleMode.None)
Height = ctrl.Height
},
AspectRatio = ctrl.Width * 1.0f / ctrl.Height,
NoScale = noScaleMode
NoScale = noScaleMode,
Font = ctrl.Font,
parentName = ctrl.Parent.Name,
FontSizeType = FontSizeType.Chinese
};

if (!_ctrlInfos.ContainsKey(ctrl.Name))
Expand Down
2 changes: 1 addition & 1 deletion AutoScaleHelper/AutoScaleHelper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>AutoScaleHelper</PackageId>
<Version>1.0.3</Version>
<Version>1.0.5</Version>
<Authors>Normal Hu</Authors>
<Description>The helper of layout scaling for winform.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
6 changes: 3 additions & 3 deletions Demo/4_动态添加控件/DynaAddCtrlForm1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public DynaAddCtrlForm1()

private void DynaAddCtrlForm1_SizeChanged(object sender, EventArgs e)
{
this.SuspendLayout();
//this.SuspendLayout();
autoScale.UpdateControlsLayout();
this.ResumeLayout();
//this.ResumeLayout();
}

private void button1_Click(object sender, EventArgs e)
Expand All @@ -43,7 +43,7 @@ private void button1_Click(object sender, EventArgs e)
this.Controls.Add(button5);
autoScale.AddControl(button5);
autoScale.UpdateControlsLayout();
this.ResumeLayout();
this.ResumeLayout();
}

private void button2_Click(object sender, EventArgs e)
Expand Down
3 changes: 1 addition & 2 deletions Demo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static void Main()
//Application.Run(new Form_Button());
//Application.Run(new Form_CheckedListBox());
//Application.Run(new Form_Combobox());
// Application.Run(new Form_DataGridView());
//Application.Run(new Form_DataGridView());
//Application.Run(new Form_Groupbox());
//Application.Run(new Form_Label());
//Application.Run(new Form_ListBox());
Expand All @@ -56,7 +56,6 @@ static void Main()
//Application.Run(new Form_TreeView());
//Application.Run(new Form_Others());
//Application.Run(new Form_Chart1());
//Application.Run(new Form1());

//Application.Run(new TestForm1());
}
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ A:调用UpdateControlsLayout时传入false参数
Q:ToolStrip内部控件没有缩放?
A:是的,因为ToolStrip内部控件缩放比较难处理,因此AutoScale类不处理它,类似的还有Form类。
另外,AutoScale在处理一些控件时会缩放其自身大小,但不会缩放其内部的控件的大小和位置,如
DataGridView,UpDownBase,TableLayoutPanel
DataGridView,UpDownBase。

有其他问题或者bug请提issue,并附上代码或图片。

Expand All @@ -148,6 +148,9 @@ DataGridView,UpDownBase,TableLayoutPanel。

## 更新

### 1.0.5更新
不好意思非常抱歉,在1.0.3版本中又测试出一个严重错误(该错误导致AutoScale的AddControl方法报错),因此更新至1.0.5版本(之所以没有1.0.4是因为4是一个不吉利的数字),请各位见谅!

### 1.0.3更新
不好意思非常抱歉,由于在1.0.2版本中存在一个低级错误,该错误可能导致一些严重问题,因此更新到1.0.3版本,请各位见谅!

Expand Down

0 comments on commit 126c873

Please sign in to comment.