* UITextBox:调整最小高度限制

This commit is contained in:
Sunny 2021-10-14 22:19:49 +08:00
parent a5db925bfc
commit 4d91059b2d
2 changed files with 16 additions and 2 deletions

Binary file not shown.

View File

@ -27,6 +27,7 @@
* 2021-08-03: V3.0.5 GotFocus和LostFocus事件
* 2021-08-15: V3.0.6
* 2021-09-07: V3.0.6
* 2021-10-14: V3.0.8
******************************************************************************/
using System;
@ -55,6 +56,7 @@ namespace Sunny.UI
ShowText = false;
Font = UIFontColor.Font;
Padding = new Padding(0);
MinimumSize = new Size(1, 16);
edit.Top = (Height - edit.Height) / 2;
edit.Left = 4;
@ -488,10 +490,22 @@ namespace Sunny.UI
{
if (!multiline)
{
if (Height < MinHeight) Height = MinHeight;
if (Height < 12) Height = MinHeight;
if (Height > MaxHeight) Height = MaxHeight;
edit.Top = (Height - edit.Height) / 2;
if (Height < MinHeight)
{
edit.AutoSize = false;
edit.Height = Height - 2;
edit.Top = 1;
}
else
{
edit.AutoSize = true;
edit.Height = MinHeight;
edit.Top = (Height - edit.Height) / 2;
}
if (icon == null && Symbol == 0)
{
edit.Left = 4 + Padding.Left;