* UITitlePanel: 删除Padding设置
This commit is contained in:
parent
2798c6d59a
commit
4b0ca7dca6
9
SunnyUI/Controls/UITitlePanel.Designer.cs
generated
9
SunnyUI/Controls/UITitlePanel.Designer.cs
generated
@ -28,14 +28,13 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// UITitlePanel
|
||||
//
|
||||
this.Name = "UITitlePanel";
|
||||
this.Padding = new System.Windows.Forms.Padding(0, 35, 0, 0);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
Name = "UITitlePanel";
|
||||
VisibleChanged += UITitlePanel_VisibleChanged;
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -25,6 +25,7 @@
|
||||
* 2023-05-02: V3.3.6 增加了一个关闭按钮的属性,点击后隐藏控件
|
||||
* 2023-05-12: V3.3.6 标题栏文字位置属性由TextAlign改为TextAlignment
|
||||
* 2023-05-12: V3.3.6 重构DrawString函数
|
||||
* 2023-07-12: V3.4.0 删除Padding设置
|
||||
******************************************************************************/
|
||||
|
||||
using System;
|
||||
@ -50,32 +51,12 @@ namespace Sunny.UI
|
||||
if (_titleHeight != value)
|
||||
{
|
||||
_titleHeight = Math.Max(19, value);
|
||||
Padding = new Padding(Padding.Left, Math.Max(value, Padding.Top), Padding.Right, Padding.Bottom);
|
||||
CalcSystemBoxPos();
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnPaddingChanged(EventArgs e)
|
||||
{
|
||||
base.OnPaddingChanged(e);
|
||||
if (Padding.Top != Math.Max(TitleHeight, Padding.Top))
|
||||
{
|
||||
Padding = new Padding(Padding.Left, Math.Max(TitleHeight, Padding.Top), Padding.Right, Padding.Bottom);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnControlAdded(ControlEventArgs e)
|
||||
{
|
||||
base.OnControlAdded(e);
|
||||
|
||||
if (e.Control.Top < TitleHeight)
|
||||
{
|
||||
e.Control.Top = TitleHeight + 1;
|
||||
}
|
||||
}
|
||||
|
||||
public UITitlePanel()
|
||||
{
|
||||
InitializeComponent();
|
||||
@ -390,5 +371,16 @@ namespace Sunny.UI
|
||||
|
||||
base.OnMouseDoubleClick(e);
|
||||
}
|
||||
|
||||
private void UITitlePanel_VisibleChanged(object sender, EventArgs e)
|
||||
{
|
||||
foreach (Control control in Controls)
|
||||
{
|
||||
if (control.Top < TitleHeight)
|
||||
{
|
||||
control.Top = TitleHeight + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -18,7 +18,7 @@
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
|
Loading…
x
Reference in New Issue
Block a user