diff --git a/Bin/SunnyUI.dll b/Bin/SunnyUI.dll index be1e0199..7fe6b7c0 100644 Binary files a/Bin/SunnyUI.dll and b/Bin/SunnyUI.dll differ diff --git a/Bin/SunnyUI.pdb b/Bin/SunnyUI.pdb index 691c20d1..d49a75b0 100644 Binary files a/Bin/SunnyUI.pdb and b/Bin/SunnyUI.pdb differ diff --git a/SunnyUI.Demo/Bin/SunnyUI.Demo.exe b/SunnyUI.Demo/Bin/SunnyUI.Demo.exe index 5d596ad9..5ca779db 100644 Binary files a/SunnyUI.Demo/Bin/SunnyUI.Demo.exe and b/SunnyUI.Demo/Bin/SunnyUI.Demo.exe differ diff --git a/SunnyUI.Demo/Bin/SunnyUI.dll b/SunnyUI.Demo/Bin/SunnyUI.dll index be1e0199..7fe6b7c0 100644 Binary files a/SunnyUI.Demo/Bin/SunnyUI.dll and b/SunnyUI.Demo/Bin/SunnyUI.dll differ diff --git a/SunnyUI.Demo/Controls/FButton.Designer.cs b/SunnyUI.Demo/Controls/FButton.Designer.cs index 34a8200f..5ab05368 100644 --- a/SunnyUI.Demo/Controls/FButton.Designer.cs +++ b/SunnyUI.Demo/Controls/FButton.Designer.cs @@ -85,6 +85,8 @@ this.uiImageButton2 = new Sunny.UI.UIImageButton(); this.uiImageButton1 = new Sunny.UI.UIImageButton(); this.uiSymbolButton26 = new Sunny.UI.UISymbolButton(); + this.uiSwitch3 = new Sunny.UI.UISwitch(); + this.uiSwitch4 = new Sunny.UI.UISwitch(); this.PagePanel.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.uiImageButton4)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.uiImageButton3)).BeginInit(); @@ -94,6 +96,8 @@ // // PagePanel // + this.PagePanel.Controls.Add(this.uiSwitch3); + this.PagePanel.Controls.Add(this.uiSwitch4); this.PagePanel.Controls.Add(this.uiSymbolButton26); this.PagePanel.Controls.Add(this.uiSymbolButton25); this.PagePanel.Controls.Add(this.uiImageButton4); @@ -165,6 +169,7 @@ this.uiButton1.ForePressColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(131)))), ((int)(((byte)(229))))); this.uiButton1.ForeSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(131)))), ((int)(((byte)(229))))); this.uiButton1.Location = new System.Drawing.Point(30, 50); + this.uiButton1.MinimumSize = new System.Drawing.Size(1, 1); this.uiButton1.Name = "uiButton1"; this.uiButton1.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(219)))), ((int)(((byte)(227))))); this.uiButton1.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(197)))), ((int)(((byte)(222)))), ((int)(((byte)(255))))); @@ -183,6 +188,7 @@ this.uiButton2.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiButton2.ForeSelectedColor = System.Drawing.Color.Empty; this.uiButton2.Location = new System.Drawing.Point(144, 50); + this.uiButton2.MinimumSize = new System.Drawing.Size(1, 1); this.uiButton2.Name = "uiButton2"; this.uiButton2.RectSelectedColor = System.Drawing.Color.Empty; this.uiButton2.ShowFocusLine = true; @@ -201,6 +207,7 @@ this.uiButton3.FillSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(168)))), ((int)(((byte)(35))))); this.uiButton3.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiButton3.Location = new System.Drawing.Point(258, 50); + this.uiButton3.MinimumSize = new System.Drawing.Size(1, 1); this.uiButton3.Name = "uiButton3"; this.uiButton3.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(110)))), ((int)(((byte)(190)))), ((int)(((byte)(40))))); this.uiButton3.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(202)))), ((int)(((byte)(81))))); @@ -222,6 +229,7 @@ this.uiButton4.FillSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(202)))), ((int)(((byte)(87)))), ((int)(((byte)(89))))); this.uiButton4.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiButton4.Location = new System.Drawing.Point(600, 50); + this.uiButton4.MinimumSize = new System.Drawing.Size(1, 1); this.uiButton4.Name = "uiButton4"; this.uiButton4.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(80)))), ((int)(((byte)(80))))); this.uiButton4.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(127)))), ((int)(((byte)(128))))); @@ -243,6 +251,7 @@ this.uiButton5.FillSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(137)))), ((int)(((byte)(43))))); this.uiButton5.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiButton5.Location = new System.Drawing.Point(486, 50); + this.uiButton5.MinimumSize = new System.Drawing.Size(1, 1); this.uiButton5.Name = "uiButton5"; this.uiButton5.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(155)))), ((int)(((byte)(40))))); this.uiButton5.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(223)))), ((int)(((byte)(174)))), ((int)(((byte)(86))))); @@ -264,6 +273,7 @@ this.uiButton6.FillSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(121)))), ((int)(((byte)(123)))), ((int)(((byte)(129))))); this.uiButton6.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiButton6.Location = new System.Drawing.Point(372, 50); + this.uiButton6.MinimumSize = new System.Drawing.Size(1, 1); this.uiButton6.Name = "uiButton6"; this.uiButton6.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(140)))), ((int)(((byte)(140))))); this.uiButton6.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(160)))), ((int)(((byte)(165))))); @@ -286,6 +296,7 @@ this.uiButton7.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiButton7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(80)))), ((int)(((byte)(80))))); this.uiButton7.Location = new System.Drawing.Point(600, 100); + this.uiButton7.MinimumSize = new System.Drawing.Size(1, 1); this.uiButton7.Name = "uiButton7"; this.uiButton7.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(80)))), ((int)(((byte)(80))))); this.uiButton7.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(80)))), ((int)(((byte)(80))))); @@ -307,6 +318,7 @@ this.uiButton8.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiButton8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(155)))), ((int)(((byte)(40))))); this.uiButton8.Location = new System.Drawing.Point(486, 100); + this.uiButton8.MinimumSize = new System.Drawing.Size(1, 1); this.uiButton8.Name = "uiButton8"; this.uiButton8.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(155)))), ((int)(((byte)(40))))); this.uiButton8.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(155)))), ((int)(((byte)(40))))); @@ -328,6 +340,7 @@ this.uiButton9.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiButton9.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(140)))), ((int)(((byte)(140))))); this.uiButton9.Location = new System.Drawing.Point(372, 100); + this.uiButton9.MinimumSize = new System.Drawing.Size(1, 1); this.uiButton9.Name = "uiButton9"; this.uiButton9.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(140)))), ((int)(((byte)(140))))); this.uiButton9.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(140)))), ((int)(((byte)(140))))); @@ -349,6 +362,7 @@ this.uiButton10.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiButton10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(110)))), ((int)(((byte)(190)))), ((int)(((byte)(40))))); this.uiButton10.Location = new System.Drawing.Point(258, 100); + this.uiButton10.MinimumSize = new System.Drawing.Size(1, 1); this.uiButton10.Name = "uiButton10"; this.uiButton10.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(110)))), ((int)(((byte)(190)))), ((int)(((byte)(40))))); this.uiButton10.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(110)))), ((int)(((byte)(190)))), ((int)(((byte)(40))))); @@ -367,6 +381,7 @@ this.uiButton11.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiButton11.ForeSelectedColor = System.Drawing.Color.Empty; this.uiButton11.Location = new System.Drawing.Point(144, 100); + this.uiButton11.MinimumSize = new System.Drawing.Size(1, 1); this.uiButton11.Name = "uiButton11"; this.uiButton11.RectSelectedColor = System.Drawing.Color.Empty; this.uiButton11.Size = new System.Drawing.Size(100, 35); @@ -387,6 +402,7 @@ this.uiButton12.ForePressColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(131)))), ((int)(((byte)(229))))); this.uiButton12.ForeSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(131)))), ((int)(((byte)(229))))); this.uiButton12.Location = new System.Drawing.Point(30, 100); + this.uiButton12.MinimumSize = new System.Drawing.Size(1, 1); this.uiButton12.Name = "uiButton12"; this.uiButton12.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(219)))), ((int)(((byte)(227))))); this.uiButton12.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(197)))), ((int)(((byte)(222)))), ((int)(((byte)(255))))); @@ -405,6 +421,7 @@ this.uiButton13.FillSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(202)))), ((int)(((byte)(87)))), ((int)(((byte)(89))))); this.uiButton13.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiButton13.Location = new System.Drawing.Point(600, 150); + this.uiButton13.MinimumSize = new System.Drawing.Size(1, 1); this.uiButton13.Name = "uiButton13"; this.uiButton13.Radius = 35; this.uiButton13.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(80)))), ((int)(((byte)(80))))); @@ -426,6 +443,7 @@ this.uiButton14.FillSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(137)))), ((int)(((byte)(43))))); this.uiButton14.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiButton14.Location = new System.Drawing.Point(486, 150); + this.uiButton14.MinimumSize = new System.Drawing.Size(1, 1); this.uiButton14.Name = "uiButton14"; this.uiButton14.Radius = 35; this.uiButton14.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(155)))), ((int)(((byte)(40))))); @@ -447,6 +465,7 @@ this.uiButton15.FillSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(121)))), ((int)(((byte)(123)))), ((int)(((byte)(129))))); this.uiButton15.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiButton15.Location = new System.Drawing.Point(372, 150); + this.uiButton15.MinimumSize = new System.Drawing.Size(1, 1); this.uiButton15.Name = "uiButton15"; this.uiButton15.Radius = 35; this.uiButton15.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(140)))), ((int)(((byte)(140)))), ((int)(((byte)(140))))); @@ -468,6 +487,7 @@ this.uiButton16.FillSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(168)))), ((int)(((byte)(35))))); this.uiButton16.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiButton16.Location = new System.Drawing.Point(258, 150); + this.uiButton16.MinimumSize = new System.Drawing.Size(1, 1); this.uiButton16.Name = "uiButton16"; this.uiButton16.Radius = 35; this.uiButton16.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(110)))), ((int)(((byte)(190)))), ((int)(((byte)(40))))); @@ -486,6 +506,7 @@ this.uiButton17.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiButton17.ForeSelectedColor = System.Drawing.Color.Empty; this.uiButton17.Location = new System.Drawing.Point(144, 150); + this.uiButton17.MinimumSize = new System.Drawing.Size(1, 1); this.uiButton17.Name = "uiButton17"; this.uiButton17.Radius = 35; this.uiButton17.RectSelectedColor = System.Drawing.Color.Empty; @@ -499,6 +520,7 @@ this.uiButton18.Cursor = System.Windows.Forms.Cursors.Hand; this.uiButton18.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiButton18.Location = new System.Drawing.Point(30, 150); + this.uiButton18.MinimumSize = new System.Drawing.Size(1, 1); this.uiButton18.Name = "uiButton18"; this.uiButton18.Radius = 35; this.uiButton18.Size = new System.Drawing.Size(100, 35); @@ -536,6 +558,7 @@ this.uiSymbolButton3.FillSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(168)))), ((int)(((byte)(35))))); this.uiSymbolButton3.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiSymbolButton3.Location = new System.Drawing.Point(372, 230); + this.uiSymbolButton3.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton3.Name = "uiSymbolButton3"; this.uiSymbolButton3.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(110)))), ((int)(((byte)(190)))), ((int)(((byte)(40))))); this.uiSymbolButton3.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(202)))), ((int)(((byte)(81))))); @@ -554,6 +577,7 @@ this.uiSymbolButton4.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiSymbolButton4.ForeSelectedColor = System.Drawing.Color.Empty; this.uiSymbolButton4.Location = new System.Drawing.Point(258, 230); + this.uiSymbolButton4.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton4.Name = "uiSymbolButton4"; this.uiSymbolButton4.RectSelectedColor = System.Drawing.Color.Empty; this.uiSymbolButton4.Size = new System.Drawing.Size(100, 35); @@ -571,6 +595,7 @@ this.uiSymbolButton5.FillSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(137)))), ((int)(((byte)(43))))); this.uiSymbolButton5.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiSymbolButton5.Location = new System.Drawing.Point(486, 230); + this.uiSymbolButton5.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton5.Name = "uiSymbolButton5"; this.uiSymbolButton5.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(155)))), ((int)(((byte)(40))))); this.uiSymbolButton5.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(223)))), ((int)(((byte)(174)))), ((int)(((byte)(86))))); @@ -592,6 +617,7 @@ this.uiSymbolButton6.FillSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(202)))), ((int)(((byte)(87)))), ((int)(((byte)(89))))); this.uiSymbolButton6.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiSymbolButton6.Location = new System.Drawing.Point(600, 230); + this.uiSymbolButton6.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton6.Name = "uiSymbolButton6"; this.uiSymbolButton6.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(80)))), ((int)(((byte)(80))))); this.uiSymbolButton6.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(127)))), ((int)(((byte)(128))))); @@ -615,6 +641,7 @@ this.uiSymbolButton7.ImageAlign = System.Drawing.ContentAlignment.TopLeft; this.uiSymbolButton7.IsCircle = true; this.uiSymbolButton7.Location = new System.Drawing.Point(235, 280); + this.uiSymbolButton7.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton7.Name = "uiSymbolButton7"; this.uiSymbolButton7.Padding = new System.Windows.Forms.Padding(7, 7, 4, 4); this.uiSymbolButton7.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(80)))), ((int)(((byte)(80))))); @@ -637,6 +664,7 @@ this.uiSymbolButton8.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiSymbolButton8.IsCircle = true; this.uiSymbolButton8.Location = new System.Drawing.Point(194, 280); + this.uiSymbolButton8.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton8.Name = "uiSymbolButton8"; this.uiSymbolButton8.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(155)))), ((int)(((byte)(40))))); this.uiSymbolButton8.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(223)))), ((int)(((byte)(174)))), ((int)(((byte)(86))))); @@ -658,6 +686,7 @@ this.uiSymbolButton9.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiSymbolButton9.IsCircle = true; this.uiSymbolButton9.Location = new System.Drawing.Point(153, 280); + this.uiSymbolButton9.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton9.Name = "uiSymbolButton9"; this.uiSymbolButton9.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(110)))), ((int)(((byte)(190)))), ((int)(((byte)(40))))); this.uiSymbolButton9.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(202)))), ((int)(((byte)(81))))); @@ -676,6 +705,7 @@ this.uiSymbolButton10.ForeSelectedColor = System.Drawing.Color.Empty; this.uiSymbolButton10.IsCircle = true; this.uiSymbolButton10.Location = new System.Drawing.Point(112, 280); + this.uiSymbolButton10.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton10.Name = "uiSymbolButton10"; this.uiSymbolButton10.RectSelectedColor = System.Drawing.Color.Empty; this.uiSymbolButton10.Size = new System.Drawing.Size(35, 35); @@ -692,6 +722,7 @@ this.uiSymbolButton11.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiSymbolButton11.IsCircle = true; this.uiSymbolButton11.Location = new System.Drawing.Point(71, 280); + this.uiSymbolButton11.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton11.Name = "uiSymbolButton11"; this.uiSymbolButton11.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(80)))), ((int)(((byte)(80))))); this.uiSymbolButton11.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(127)))), ((int)(((byte)(128))))); @@ -718,6 +749,7 @@ this.uiSymbolButton12.ForeSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(131)))), ((int)(((byte)(229))))); this.uiSymbolButton12.IsCircle = true; this.uiSymbolButton12.Location = new System.Drawing.Point(30, 280); + this.uiSymbolButton12.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton12.Name = "uiSymbolButton12"; this.uiSymbolButton12.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(219)))), ((int)(((byte)(227))))); this.uiSymbolButton12.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(197)))), ((int)(((byte)(222)))), ((int)(((byte)(255))))); @@ -743,6 +775,7 @@ this.uiSymbolButton13.Cursor = System.Windows.Forms.Cursors.Hand; this.uiSymbolButton13.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiSymbolButton13.Location = new System.Drawing.Point(260, 360); + this.uiSymbolButton13.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton13.Name = "uiSymbolButton13"; this.uiSymbolButton13.RadiusSides = Sunny.UI.UICornerRadiusSides.None; this.uiSymbolButton13.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) @@ -756,6 +789,7 @@ this.uiSymbolButton14.Cursor = System.Windows.Forms.Cursors.Hand; this.uiSymbolButton14.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiSymbolButton14.Location = new System.Drawing.Point(214, 360); + this.uiSymbolButton14.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton14.Name = "uiSymbolButton14"; this.uiSymbolButton14.RadiusSides = Sunny.UI.UICornerRadiusSides.None; this.uiSymbolButton14.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) @@ -769,6 +803,7 @@ this.uiSymbolButton15.Cursor = System.Windows.Forms.Cursors.Hand; this.uiSymbolButton15.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiSymbolButton15.Location = new System.Drawing.Point(168, 360); + this.uiSymbolButton15.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton15.Name = "uiSymbolButton15"; this.uiSymbolButton15.RadiusSides = Sunny.UI.UICornerRadiusSides.None; this.uiSymbolButton15.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) @@ -782,6 +817,7 @@ this.uiSymbolButton16.Cursor = System.Windows.Forms.Cursors.Hand; this.uiSymbolButton16.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiSymbolButton16.Location = new System.Drawing.Point(122, 360); + this.uiSymbolButton16.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton16.Name = "uiSymbolButton16"; this.uiSymbolButton16.RadiusSides = Sunny.UI.UICornerRadiusSides.None; this.uiSymbolButton16.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) @@ -795,6 +831,7 @@ this.uiSymbolButton17.Cursor = System.Windows.Forms.Cursors.Hand; this.uiSymbolButton17.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiSymbolButton17.Location = new System.Drawing.Point(76, 360); + this.uiSymbolButton17.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton17.Name = "uiSymbolButton17"; this.uiSymbolButton17.RadiusSides = Sunny.UI.UICornerRadiusSides.None; this.uiSymbolButton17.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) @@ -808,6 +845,7 @@ this.uiSymbolButton18.Cursor = System.Windows.Forms.Cursors.Hand; this.uiSymbolButton18.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiSymbolButton18.Location = new System.Drawing.Point(30, 360); + this.uiSymbolButton18.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton18.Name = "uiSymbolButton18"; this.uiSymbolButton18.RadiusSides = ((Sunny.UI.UICornerRadiusSides)((Sunny.UI.UICornerRadiusSides.LeftTop | Sunny.UI.UICornerRadiusSides.LeftBottom))); this.uiSymbolButton18.Size = new System.Drawing.Size(46, 35); @@ -819,6 +857,7 @@ this.uiSymbolButton19.Cursor = System.Windows.Forms.Cursors.Hand; this.uiSymbolButton19.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiSymbolButton19.Location = new System.Drawing.Point(516, 360); + this.uiSymbolButton19.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton19.Name = "uiSymbolButton19"; this.uiSymbolButton19.RadiusSides = ((Sunny.UI.UICornerRadiusSides)((Sunny.UI.UICornerRadiusSides.LeftTop | Sunny.UI.UICornerRadiusSides.LeftBottom))); this.uiSymbolButton19.Size = new System.Drawing.Size(46, 35); @@ -830,6 +869,7 @@ this.uiSymbolButton20.Cursor = System.Windows.Forms.Cursors.Hand; this.uiSymbolButton20.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiSymbolButton20.Location = new System.Drawing.Point(352, 360); + this.uiSymbolButton20.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton20.Name = "uiSymbolButton20"; this.uiSymbolButton20.RadiusSides = ((Sunny.UI.UICornerRadiusSides)((Sunny.UI.UICornerRadiusSides.RightTop | Sunny.UI.UICornerRadiusSides.RightBottom))); this.uiSymbolButton20.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) @@ -843,6 +883,7 @@ this.uiSymbolButton21.Cursor = System.Windows.Forms.Cursors.Hand; this.uiSymbolButton21.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiSymbolButton21.Location = new System.Drawing.Point(306, 360); + this.uiSymbolButton21.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton21.Name = "uiSymbolButton21"; this.uiSymbolButton21.RadiusSides = Sunny.UI.UICornerRadiusSides.None; this.uiSymbolButton21.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) @@ -856,6 +897,7 @@ this.uiSymbolButton22.Cursor = System.Windows.Forms.Cursors.Hand; this.uiSymbolButton22.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiSymbolButton22.Location = new System.Drawing.Point(562, 360); + this.uiSymbolButton22.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton22.Name = "uiSymbolButton22"; this.uiSymbolButton22.RadiusSides = Sunny.UI.UICornerRadiusSides.None; this.uiSymbolButton22.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) @@ -869,6 +911,7 @@ this.uiSymbolButton23.Cursor = System.Windows.Forms.Cursors.Hand; this.uiSymbolButton23.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiSymbolButton23.Location = new System.Drawing.Point(608, 360); + this.uiSymbolButton23.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton23.Name = "uiSymbolButton23"; this.uiSymbolButton23.RadiusSides = Sunny.UI.UICornerRadiusSides.None; this.uiSymbolButton23.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) @@ -882,6 +925,7 @@ this.uiSymbolButton24.Cursor = System.Windows.Forms.Cursors.Hand; this.uiSymbolButton24.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiSymbolButton24.Location = new System.Drawing.Point(654, 360); + this.uiSymbolButton24.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton24.Name = "uiSymbolButton24"; this.uiSymbolButton24.RadiusSides = ((Sunny.UI.UICornerRadiusSides)((Sunny.UI.UICornerRadiusSides.RightTop | Sunny.UI.UICornerRadiusSides.RightBottom))); this.uiSymbolButton24.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) @@ -897,6 +941,7 @@ this.uiSwitch1.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiSwitch1.InActiveText = "Off"; this.uiSwitch1.Location = new System.Drawing.Point(30, 441); + this.uiSwitch1.MinimumSize = new System.Drawing.Size(1, 1); this.uiSwitch1.Name = "uiSwitch1"; this.uiSwitch1.Size = new System.Drawing.Size(75, 29); this.uiSwitch1.TabIndex = 45; @@ -917,6 +962,7 @@ // this.uiSwitch2.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiSwitch2.Location = new System.Drawing.Point(112, 441); + this.uiSwitch2.MinimumSize = new System.Drawing.Size(1, 1); this.uiSwitch2.Name = "uiSwitch2"; this.uiSwitch2.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.None; this.uiSwitch2.Size = new System.Drawing.Size(75, 29); @@ -947,6 +993,7 @@ this.uiSymbolButton1.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiSymbolButton1.ForeSelectedColor = System.Drawing.Color.Empty; this.uiSymbolButton1.Location = new System.Drawing.Point(30, 230); + this.uiSymbolButton1.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton1.Name = "uiSymbolButton1"; this.uiSymbolButton1.RectSelectedColor = System.Drawing.Color.Empty; this.uiSymbolButton1.Size = new System.Drawing.Size(100, 35); @@ -963,6 +1010,7 @@ this.uiSymbolButton2.FillSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(202)))), ((int)(((byte)(87)))), ((int)(((byte)(89))))); this.uiSymbolButton2.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiSymbolButton2.Location = new System.Drawing.Point(144, 230); + this.uiSymbolButton2.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton2.Name = "uiSymbolButton2"; this.uiSymbolButton2.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(80)))), ((int)(((byte)(80))))); this.uiSymbolButton2.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(127)))), ((int)(((byte)(128))))); @@ -985,6 +1033,7 @@ this.uiSymbolButton25.Image = global::Sunny.UI.Demo.Properties.Resources.relationship; this.uiSymbolButton25.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; this.uiSymbolButton25.Location = new System.Drawing.Point(600, 280); + this.uiSymbolButton25.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton25.Name = "uiSymbolButton25"; this.uiSymbolButton25.Padding = new System.Windows.Forms.Padding(10, 0, 5, 0); this.uiSymbolButton25.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255))))); @@ -1066,6 +1115,7 @@ this.uiSymbolButton26.Image = global::Sunny.UI.Demo.Properties.Resources.save; this.uiSymbolButton26.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.uiSymbolButton26.Location = new System.Drawing.Point(486, 280); + this.uiSymbolButton26.MinimumSize = new System.Drawing.Size(1, 1); this.uiSymbolButton26.Name = "uiSymbolButton26"; this.uiSymbolButton26.Padding = new System.Windows.Forms.Padding(5, 0, 10, 0); this.uiSymbolButton26.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255))))); @@ -1077,6 +1127,32 @@ this.uiSymbolButton26.Text = "Save"; this.uiSymbolButton26.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // + // uiSwitch3 + // + this.uiSwitch3.Font = new System.Drawing.Font("微软雅黑", 12F); + this.uiSwitch3.Location = new System.Drawing.Point(275, 441); + this.uiSwitch3.MinimumSize = new System.Drawing.Size(1, 1); + this.uiSwitch3.Name = "uiSwitch3"; + this.uiSwitch3.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.None; + this.uiSwitch3.Size = new System.Drawing.Size(75, 29); + this.uiSwitch3.SwitchShape = Sunny.UI.UISwitch.UISwitchShape.Square; + this.uiSwitch3.TabIndex = 58; + this.uiSwitch3.Text = "uiSwitch3"; + // + // uiSwitch4 + // + this.uiSwitch4.Active = true; + this.uiSwitch4.ActiveText = "On"; + this.uiSwitch4.Font = new System.Drawing.Font("微软雅黑", 12F); + this.uiSwitch4.InActiveText = "Off"; + this.uiSwitch4.Location = new System.Drawing.Point(193, 441); + this.uiSwitch4.MinimumSize = new System.Drawing.Size(1, 1); + this.uiSwitch4.Name = "uiSwitch4"; + this.uiSwitch4.Size = new System.Drawing.Size(75, 29); + this.uiSwitch4.SwitchShape = Sunny.UI.UISwitch.UISwitchShape.Square; + this.uiSwitch4.TabIndex = 57; + this.uiSwitch4.Text = "uiSwitch4"; + // // FButton // this.AlwaysOpen = true; @@ -1153,5 +1229,7 @@ private UISymbolButton uiSymbolButton2; private UISymbolButton uiSymbolButton1; private UISymbolButton uiSymbolButton26; + private UISwitch uiSwitch3; + private UISwitch uiSwitch4; } } \ No newline at end of file diff --git a/SunnyUI/Controls/UISwitch.cs b/SunnyUI/Controls/UISwitch.cs index 3a4a4051..0593620a 100644 --- a/SunnyUI/Controls/UISwitch.cs +++ b/SunnyUI/Controls/UISwitch.cs @@ -189,22 +189,44 @@ namespace Sunny.UI protected override void OnPaintFill(Graphics g, GraphicsPath path) { - //Width = (int)(Height * 2.6); - Rectangle rect = new Rectangle(0, 0, Width - 1, Height - 1); - g.FillRoundRectangle(Active ? ActiveColor : InActiveColor, rect, rect.Height); + if (SwitchShape == UISwitchShape.Round) + { + Rectangle rect = new Rectangle(0, 0, Width - 1, Height - 1); + g.FillRoundRectangle(Active ? ActiveColor : InActiveColor, rect, rect.Height); - int width = Width - 3 - 1 - 3 - (rect.Height - 6); - if (!Active) - { - g.FillEllipse(fillColor.IsValid() ? fillColor : Color.White, 3, 3, rect.Height - 6, rect.Height - 6); - SizeF sf = g.MeasureString(InActiveText, Font); - g.DrawString(InActiveText, Font, fillColor.IsValid() ? fillColor : Color.White, 3 + rect.Height - 6 + (width - sf.Width) / 2, 3 + (rect.Height - 6 - sf.Height) / 2); + int width = Width - 3 - 1 - 3 - (rect.Height - 6); + if (!Active) + { + g.FillEllipse(fillColor.IsValid() ? fillColor : Color.White, 3, 3, rect.Height - 6, rect.Height - 6); + SizeF sf = g.MeasureString(InActiveText, Font); + g.DrawString(InActiveText, Font, fillColor.IsValid() ? fillColor : Color.White, 3 + rect.Height - 6 + (width - sf.Width) / 2, 3 + (rect.Height - 6 - sf.Height) / 2); + } + else + { + g.FillEllipse(fillColor.IsValid() ? fillColor : Color.White, Width - 3 - 1 - (rect.Height - 6), 3, rect.Height - 6, rect.Height - 6); + SizeF sf = g.MeasureString(ActiveText, Font); + g.DrawString(ActiveText, Font, fillColor.IsValid() ? fillColor : Color.White, 3 + (width - sf.Width) / 2, 3 + (rect.Height - 6 - sf.Height) / 2); + } } - else + + if (SwitchShape == UISwitchShape.Square) { - g.FillEllipse(fillColor.IsValid() ? fillColor : Color.White, Width - 3 - 1 - (rect.Height - 6), 3, rect.Height - 6, rect.Height - 6); - SizeF sf = g.MeasureString(ActiveText, Font); - g.DrawString(ActiveText, Font, fillColor.IsValid() ? fillColor : Color.White, 3 + (width - sf.Width) / 2, 3 + (rect.Height - 6 - sf.Height) / 2); + Rectangle rect = new Rectangle(0, 0, Width - 1, Height - 1); + g.FillRoundRectangle(Active ? ActiveColor : InActiveColor, rect, Radius); + + int width = Width - 3 - 1 - 3 - (rect.Height - 6); + if (!Active) + { + g.FillRoundRectangle(fillColor.IsValid() ? fillColor : Color.White, 3, 3, rect.Height - 6, rect.Height - 6, Radius); + SizeF sf = g.MeasureString(InActiveText, Font); + g.DrawString(InActiveText, Font, fillColor.IsValid() ? fillColor : Color.White, 3 + rect.Height - 6 + (width - sf.Width) / 2, 3 + (rect.Height - 6 - sf.Height) / 2); + } + else + { + g.FillRoundRectangle(fillColor.IsValid() ? fillColor : Color.White, Width - 3 - 1 - (rect.Height - 6), 3, rect.Height - 6, rect.Height - 6, Radius); + SizeF sf = g.MeasureString(ActiveText, Font); + g.DrawString(ActiveText, Font, fillColor.IsValid() ? fillColor : Color.White, 3 + (width - sf.Width) / 2, 3 + (rect.Height - 6 - sf.Height) / 2); + } } } }