* 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>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
this.SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// UITitlePanel
|
// UITitlePanel
|
||||||
//
|
//
|
||||||
this.Name = "UITitlePanel";
|
Name = "UITitlePanel";
|
||||||
this.Padding = new System.Windows.Forms.Padding(0, 35, 0, 0);
|
VisibleChanged += UITitlePanel_VisibleChanged;
|
||||||
this.ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
* 2023-05-02: V3.3.6 增加了一个关闭按钮的属性,点击后隐藏控件
|
* 2023-05-02: V3.3.6 增加了一个关闭按钮的属性,点击后隐藏控件
|
||||||
* 2023-05-12: V3.3.6 标题栏文字位置属性由TextAlign改为TextAlignment
|
* 2023-05-12: V3.3.6 标题栏文字位置属性由TextAlign改为TextAlignment
|
||||||
* 2023-05-12: V3.3.6 重构DrawString函数
|
* 2023-05-12: V3.3.6 重构DrawString函数
|
||||||
|
* 2023-07-12: V3.4.0 删除Padding设置
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@ -50,32 +51,12 @@ namespace Sunny.UI
|
|||||||
if (_titleHeight != value)
|
if (_titleHeight != value)
|
||||||
{
|
{
|
||||||
_titleHeight = Math.Max(19, value);
|
_titleHeight = Math.Max(19, value);
|
||||||
Padding = new Padding(Padding.Left, Math.Max(value, Padding.Top), Padding.Right, Padding.Bottom);
|
|
||||||
CalcSystemBoxPos();
|
CalcSystemBoxPos();
|
||||||
Invalidate();
|
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()
|
public UITitlePanel()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@ -390,5 +371,16 @@ namespace Sunny.UI
|
|||||||
|
|
||||||
base.OnMouseDoubleClick(e);
|
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="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
<resheader name="writer">System.Resources.ResXResourceWriter, 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="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">
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
</data>
|
</data>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user