diff --git a/Bin/SunnyUI.dll b/Bin/SunnyUI.dll index 50a0d96c..76cc7b01 100644 Binary files a/Bin/SunnyUI.dll and b/Bin/SunnyUI.dll differ diff --git a/Bin/SunnyUI.pdb b/Bin/SunnyUI.pdb index 24c9e447..40c4c943 100644 Binary files a/Bin/SunnyUI.pdb and b/Bin/SunnyUI.pdb differ diff --git a/SunnyUI.Demo/Bin/SunnyUI.dll b/SunnyUI.Demo/Bin/SunnyUI.dll index 50a0d96c..76cc7b01 100644 Binary files a/SunnyUI.Demo/Bin/SunnyUI.dll and b/SunnyUI.Demo/Bin/SunnyUI.dll differ diff --git a/SunnyUI/Forms/UIForm.cs b/SunnyUI/Forms/UIForm.cs index 057b9abf..20bff713 100644 --- a/SunnyUI/Forms/UIForm.cs +++ b/SunnyUI/Forms/UIForm.cs @@ -45,8 +45,6 @@ namespace Sunny.UI { InitializeComponent(); - base.BackColor = UIColor.LightBlue; - if (this.Register()) { SetStyle(UIStyles.Style); @@ -55,13 +53,7 @@ namespace Sunny.UI SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.DoubleBuffer, true); - base.DoubleBuffered = true; - Padding = new Padding(0, titleHeight, 0, 0); UpdateStyles(); - - base.Font = UIFontColor.Font; - FormBorderStyle = FormBorderStyle.None; - StartPosition = FormStartPosition.CenterScreen; Version = UIGlobal.Version; } @@ -147,10 +139,10 @@ namespace Sunny.UI } } - // if (ShowTitle && e.Control.Top < TitleHeight) - // { - // e.Control.Top = TitleHeight; - // } + if (e.Control.Top < TitleHeight) + { + e.Control.Top = Padding.Top; + } } [DefaultValue(null)] @@ -283,9 +275,10 @@ namespace Sunny.UI get => titleHeight; set { - titleHeight = Math.Max(value, 0); - CalcSystemBoxPos(); + titleHeight = Math.Max(value, 31); + Padding = new Padding(0, showTitle ? titleHeight : 0, 0, 0); Invalidate(); + CalcSystemBoxPos(); } } @@ -850,7 +843,7 @@ namespace Sunny.UI e.Graphics.DrawLine(Color.White, MaximizeBoxRect.Left + MaximizeBoxRect.Width / 2 - 2, MaximizeBoxRect.Top + MaximizeBoxRect.Height / 2 - 4, - MaximizeBoxRect.Left + MaximizeBoxRect.Width / 2 +5, + MaximizeBoxRect.Left + MaximizeBoxRect.Width / 2 + 5, MaximizeBoxRect.Top + MaximizeBoxRect.Height / 2 - 4); e.Graphics.DrawLine(Color.White, diff --git a/SunnyUI/Forms/UIForm.designer.cs b/SunnyUI/Forms/UIForm.designer.cs index 0740a826..e9212cb5 100644 --- a/SunnyUI/Forms/UIForm.designer.cs +++ b/SunnyUI/Forms/UIForm.designer.cs @@ -35,8 +35,14 @@ // UIForm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255))))); this.ClientSize = new System.Drawing.Size(800, 480); + this.DoubleBuffered = true; + this.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "UIForm"; + this.Padding = new System.Windows.Forms.Padding(0, 35, 0, 0); + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "UIForm"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.UIForm_FormClosing); this.ResumeLayout(false);