+ UIHeaderButton:新增大图标的导航按钮

This commit is contained in:
Sunny 2021-02-10 17:05:29 +08:00
parent 25bece0bf4
commit 9ccb14fe82
22 changed files with 1167 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,466 @@

namespace Sunny.UI.Demo
{
partial class FHeaderButton
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.uiPanel1 = new Sunny.UI.UIPanel();
this.uiHeaderButton12 = new Sunny.UI.Controls.UIHeaderButton();
this.uiHeaderButton11 = new Sunny.UI.Controls.UIHeaderButton();
this.uiHeaderButton10 = new Sunny.UI.Controls.UIHeaderButton();
this.uiHeaderButton9 = new Sunny.UI.Controls.UIHeaderButton();
this.uiHeaderButton8 = new Sunny.UI.Controls.UIHeaderButton();
this.uiHeaderButton1 = new Sunny.UI.Controls.UIHeaderButton();
this.uiPanel2 = new Sunny.UI.UIPanel();
this.uiHeaderButton6 = new Sunny.UI.Controls.UIHeaderButton();
this.uiHeaderButton7 = new Sunny.UI.Controls.UIHeaderButton();
this.uiHeaderButton4 = new Sunny.UI.Controls.UIHeaderButton();
this.uiHeaderButton5 = new Sunny.UI.Controls.UIHeaderButton();
this.uiHeaderButton3 = new Sunny.UI.Controls.UIHeaderButton();
this.uiHeaderButton2 = new Sunny.UI.Controls.UIHeaderButton();
this.PagePanel.SuspendLayout();
this.uiPanel1.SuspendLayout();
this.uiPanel2.SuspendLayout();
this.SuspendLayout();
//
// PagePanel
//
this.PagePanel.Controls.Add(this.uiPanel2);
this.PagePanel.Controls.Add(this.uiPanel1);
this.PagePanel.Size = new System.Drawing.Size(837, 501);
//
// uiPanel1
//
this.uiPanel1.Controls.Add(this.uiHeaderButton12);
this.uiPanel1.Controls.Add(this.uiHeaderButton11);
this.uiPanel1.Controls.Add(this.uiHeaderButton10);
this.uiPanel1.Controls.Add(this.uiHeaderButton9);
this.uiPanel1.Controls.Add(this.uiHeaderButton8);
this.uiPanel1.Controls.Add(this.uiHeaderButton1);
this.uiPanel1.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
this.uiPanel1.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiPanel1.Location = new System.Drawing.Point(17, 57);
this.uiPanel1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel1.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel1.Name = "uiPanel1";
this.uiPanel1.Size = new System.Drawing.Size(737, 88);
this.uiPanel1.Style = Sunny.UI.UIStyle.Custom;
this.uiPanel1.StyleCustomMode = true;
this.uiPanel1.TabIndex = 0;
this.uiPanel1.Text = null;
//
// uiHeaderButton12
//
this.uiHeaderButton12.CircleColor = System.Drawing.Color.Olive;
this.uiHeaderButton12.CircleSize = 50;
this.uiHeaderButton12.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiHeaderButton12.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiHeaderButton12.ImageTop = 0;
this.uiHeaderButton12.Location = new System.Drawing.Point(616, 1);
this.uiHeaderButton12.MinimumSize = new System.Drawing.Size(1, 1);
this.uiHeaderButton12.Name = "uiHeaderButton12";
this.uiHeaderButton12.Padding = new System.Windows.Forms.Padding(0, 8, 0, 3);
this.uiHeaderButton12.PageIndex = 0;
this.uiHeaderButton12.Radius = 0;
this.uiHeaderButton12.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
this.uiHeaderButton12.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.None;
this.uiHeaderButton12.Size = new System.Drawing.Size(100, 88);
this.uiHeaderButton12.Style = Sunny.UI.UIStyle.Custom;
this.uiHeaderButton12.Symbol = 61459;
this.uiHeaderButton12.SymbolColor = System.Drawing.Color.White;
this.uiHeaderButton12.SymbolOffset = new System.Drawing.Point(1, 2);
this.uiHeaderButton12.SymbolSize = 41;
this.uiHeaderButton12.TabIndex = 5;
this.uiHeaderButton12.Text = "设置";
//
// uiHeaderButton11
//
this.uiHeaderButton11.CircleColor = System.Drawing.Color.Purple;
this.uiHeaderButton11.CircleSize = 50;
this.uiHeaderButton11.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiHeaderButton11.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiHeaderButton11.ImageTop = 0;
this.uiHeaderButton11.Location = new System.Drawing.Point(516, 1);
this.uiHeaderButton11.MinimumSize = new System.Drawing.Size(1, 1);
this.uiHeaderButton11.Name = "uiHeaderButton11";
this.uiHeaderButton11.Padding = new System.Windows.Forms.Padding(0, 8, 0, 3);
this.uiHeaderButton11.PageIndex = 0;
this.uiHeaderButton11.Radius = 0;
this.uiHeaderButton11.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
this.uiHeaderButton11.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.None;
this.uiHeaderButton11.Size = new System.Drawing.Size(100, 88);
this.uiHeaderButton11.Style = Sunny.UI.UIStyle.Custom;
this.uiHeaderButton11.Symbol = 61447;
this.uiHeaderButton11.SymbolColor = System.Drawing.Color.White;
this.uiHeaderButton11.SymbolOffset = new System.Drawing.Point(1, 0);
this.uiHeaderButton11.SymbolSize = 40;
this.uiHeaderButton11.TabIndex = 4;
this.uiHeaderButton11.Text = "朋友";
//
// uiHeaderButton10
//
this.uiHeaderButton10.CircleColor = System.Drawing.Color.Teal;
this.uiHeaderButton10.CircleSize = 50;
this.uiHeaderButton10.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiHeaderButton10.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiHeaderButton10.ImageTop = 0;
this.uiHeaderButton10.Location = new System.Drawing.Point(416, 1);
this.uiHeaderButton10.MinimumSize = new System.Drawing.Size(1, 1);
this.uiHeaderButton10.Name = "uiHeaderButton10";
this.uiHeaderButton10.Padding = new System.Windows.Forms.Padding(0, 8, 0, 3);
this.uiHeaderButton10.PageIndex = 0;
this.uiHeaderButton10.Radius = 0;
this.uiHeaderButton10.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
this.uiHeaderButton10.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.None;
this.uiHeaderButton10.Size = new System.Drawing.Size(100, 88);
this.uiHeaderButton10.Style = Sunny.UI.UIStyle.Custom;
this.uiHeaderButton10.Symbol = 62145;
this.uiHeaderButton10.SymbolColor = System.Drawing.Color.White;
this.uiHeaderButton10.SymbolOffset = new System.Drawing.Point(1, 2);
this.uiHeaderButton10.SymbolSize = 38;
this.uiHeaderButton10.TabIndex = 3;
this.uiHeaderButton10.Text = "手机";
//
// uiHeaderButton9
//
this.uiHeaderButton9.CircleColor = System.Drawing.Color.DarkOrange;
this.uiHeaderButton9.CircleSize = 50;
this.uiHeaderButton9.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiHeaderButton9.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiHeaderButton9.ImageTop = 0;
this.uiHeaderButton9.Location = new System.Drawing.Point(316, 1);
this.uiHeaderButton9.MinimumSize = new System.Drawing.Size(1, 1);
this.uiHeaderButton9.Name = "uiHeaderButton9";
this.uiHeaderButton9.Padding = new System.Windows.Forms.Padding(0, 8, 0, 3);
this.uiHeaderButton9.PageIndex = 0;
this.uiHeaderButton9.Radius = 0;
this.uiHeaderButton9.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
this.uiHeaderButton9.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.None;
this.uiHeaderButton9.Size = new System.Drawing.Size(100, 88);
this.uiHeaderButton9.Style = Sunny.UI.UIStyle.Custom;
this.uiHeaderButton9.Symbol = 61664;
this.uiHeaderButton9.SymbolColor = System.Drawing.Color.White;
this.uiHeaderButton9.SymbolOffset = new System.Drawing.Point(0, 1);
this.uiHeaderButton9.SymbolSize = 40;
this.uiHeaderButton9.TabIndex = 2;
this.uiHeaderButton9.Text = "邮件";
//
// uiHeaderButton8
//
this.uiHeaderButton8.CircleColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
this.uiHeaderButton8.CircleSize = 50;
this.uiHeaderButton8.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiHeaderButton8.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiHeaderButton8.ImageTop = 0;
this.uiHeaderButton8.Location = new System.Drawing.Point(216, 1);
this.uiHeaderButton8.MinimumSize = new System.Drawing.Size(1, 1);
this.uiHeaderButton8.Name = "uiHeaderButton8";
this.uiHeaderButton8.Padding = new System.Windows.Forms.Padding(0, 8, 0, 3);
this.uiHeaderButton8.PageIndex = 0;
this.uiHeaderButton8.Radius = 0;
this.uiHeaderButton8.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
this.uiHeaderButton8.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.None;
this.uiHeaderButton8.Size = new System.Drawing.Size(100, 88);
this.uiHeaderButton8.Style = Sunny.UI.UIStyle.Custom;
this.uiHeaderButton8.Symbol = 62074;
this.uiHeaderButton8.SymbolColor = System.Drawing.Color.White;
this.uiHeaderButton8.SymbolOffset = new System.Drawing.Point(1, 0);
this.uiHeaderButton8.SymbolSize = 44;
this.uiHeaderButton8.TabIndex = 1;
this.uiHeaderButton8.Text = "消息";
//
// uiHeaderButton1
//
this.uiHeaderButton1.CircleColor = System.Drawing.Color.RoyalBlue;
this.uiHeaderButton1.CircleSize = 50;
this.uiHeaderButton1.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiHeaderButton1.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiHeaderButton1.ImageTop = 0;
this.uiHeaderButton1.Location = new System.Drawing.Point(116, 1);
this.uiHeaderButton1.MinimumSize = new System.Drawing.Size(1, 1);
this.uiHeaderButton1.Name = "uiHeaderButton1";
this.uiHeaderButton1.Padding = new System.Windows.Forms.Padding(0, 8, 0, 3);
this.uiHeaderButton1.PageIndex = 0;
this.uiHeaderButton1.Radius = 0;
this.uiHeaderButton1.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
this.uiHeaderButton1.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.None;
this.uiHeaderButton1.Size = new System.Drawing.Size(100, 88);
this.uiHeaderButton1.Style = Sunny.UI.UIStyle.Custom;
this.uiHeaderButton1.Symbol = 61461;
this.uiHeaderButton1.SymbolColor = System.Drawing.Color.White;
this.uiHeaderButton1.SymbolOffset = new System.Drawing.Point(0, 0);
this.uiHeaderButton1.TabIndex = 0;
this.uiHeaderButton1.Text = "主页";
//
// uiPanel2
//
this.uiPanel2.Controls.Add(this.uiHeaderButton6);
this.uiPanel2.Controls.Add(this.uiHeaderButton7);
this.uiPanel2.Controls.Add(this.uiHeaderButton4);
this.uiPanel2.Controls.Add(this.uiHeaderButton5);
this.uiPanel2.Controls.Add(this.uiHeaderButton3);
this.uiPanel2.Controls.Add(this.uiHeaderButton2);
this.uiPanel2.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(37)))), ((int)(((byte)(40)))), ((int)(((byte)(43)))));
this.uiPanel2.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiPanel2.ForeColor = System.Drawing.Color.Silver;
this.uiPanel2.Location = new System.Drawing.Point(17, 202);
this.uiPanel2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel2.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel2.Name = "uiPanel2";
this.uiPanel2.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(130)))), ((int)(((byte)(130)))));
this.uiPanel2.Size = new System.Drawing.Size(737, 88);
this.uiPanel2.Style = Sunny.UI.UIStyle.Custom;
this.uiPanel2.StyleCustomMode = true;
this.uiPanel2.TabIndex = 1;
this.uiPanel2.Text = null;
//
// uiHeaderButton6
//
this.uiHeaderButton6.CircleColor = System.Drawing.Color.Bisque;
this.uiHeaderButton6.CircleSize = 50;
this.uiHeaderButton6.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiHeaderButton6.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(37)))), ((int)(((byte)(40)))), ((int)(((byte)(43)))));
this.uiHeaderButton6.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
this.uiHeaderButton6.FillPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.uiHeaderButton6.FillSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.uiHeaderButton6.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiHeaderButton6.ForeHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(130)))), ((int)(((byte)(130)))));
this.uiHeaderButton6.ForePressColor = System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(130)))), ((int)(((byte)(130)))));
this.uiHeaderButton6.ForeSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(130)))), ((int)(((byte)(130)))));
this.uiHeaderButton6.Image = global::Sunny.UI.Demo.Properties.Resources._7;
this.uiHeaderButton6.ImageTop = 0;
this.uiHeaderButton6.Location = new System.Drawing.Point(616, 1);
this.uiHeaderButton6.MinimumSize = new System.Drawing.Size(1, 1);
this.uiHeaderButton6.Name = "uiHeaderButton6";
this.uiHeaderButton6.Padding = new System.Windows.Forms.Padding(0, 5, 0, 3);
this.uiHeaderButton6.PageIndex = 0;
this.uiHeaderButton6.Radius = 0;
this.uiHeaderButton6.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
this.uiHeaderButton6.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.None;
this.uiHeaderButton6.Size = new System.Drawing.Size(100, 86);
this.uiHeaderButton6.Style = Sunny.UI.UIStyle.Custom;
this.uiHeaderButton6.StyleCustomMode = true;
this.uiHeaderButton6.Symbol = 0;
this.uiHeaderButton6.SymbolColor = System.Drawing.Color.White;
this.uiHeaderButton6.SymbolOffset = new System.Drawing.Point(0, 0);
this.uiHeaderButton6.TabIndex = 5;
this.uiHeaderButton6.Text = "设置";
//
// uiHeaderButton7
//
this.uiHeaderButton7.CircleColor = System.Drawing.Color.Bisque;
this.uiHeaderButton7.CircleSize = 50;
this.uiHeaderButton7.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiHeaderButton7.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(37)))), ((int)(((byte)(40)))), ((int)(((byte)(43)))));
this.uiHeaderButton7.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
this.uiHeaderButton7.FillPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.uiHeaderButton7.FillSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.uiHeaderButton7.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiHeaderButton7.ForeHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(130)))), ((int)(((byte)(130)))));
this.uiHeaderButton7.ForePressColor = System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(130)))), ((int)(((byte)(130)))));
this.uiHeaderButton7.ForeSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(130)))), ((int)(((byte)(130)))));
this.uiHeaderButton7.Image = global::Sunny.UI.Demo.Properties.Resources._5;
this.uiHeaderButton7.ImageTop = 0;
this.uiHeaderButton7.Location = new System.Drawing.Point(516, 1);
this.uiHeaderButton7.MinimumSize = new System.Drawing.Size(1, 1);
this.uiHeaderButton7.Name = "uiHeaderButton7";
this.uiHeaderButton7.Padding = new System.Windows.Forms.Padding(0, 5, 0, 3);
this.uiHeaderButton7.PageIndex = 0;
this.uiHeaderButton7.Radius = 0;
this.uiHeaderButton7.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
this.uiHeaderButton7.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.None;
this.uiHeaderButton7.Size = new System.Drawing.Size(100, 86);
this.uiHeaderButton7.Style = Sunny.UI.UIStyle.Custom;
this.uiHeaderButton7.StyleCustomMode = true;
this.uiHeaderButton7.Symbol = 0;
this.uiHeaderButton7.SymbolColor = System.Drawing.Color.White;
this.uiHeaderButton7.SymbolOffset = new System.Drawing.Point(0, 0);
this.uiHeaderButton7.TabIndex = 4;
this.uiHeaderButton7.Text = "朋友";
//
// uiHeaderButton4
//
this.uiHeaderButton4.CircleColor = System.Drawing.Color.Bisque;
this.uiHeaderButton4.CircleSize = 50;
this.uiHeaderButton4.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiHeaderButton4.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(37)))), ((int)(((byte)(40)))), ((int)(((byte)(43)))));
this.uiHeaderButton4.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
this.uiHeaderButton4.FillPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.uiHeaderButton4.FillSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.uiHeaderButton4.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiHeaderButton4.ForeHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(130)))), ((int)(((byte)(130)))));
this.uiHeaderButton4.ForePressColor = System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(130)))), ((int)(((byte)(130)))));
this.uiHeaderButton4.ForeSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(130)))), ((int)(((byte)(130)))));
this.uiHeaderButton4.Image = global::Sunny.UI.Demo.Properties.Resources._4;
this.uiHeaderButton4.ImageTop = 0;
this.uiHeaderButton4.Location = new System.Drawing.Point(416, 1);
this.uiHeaderButton4.MinimumSize = new System.Drawing.Size(1, 1);
this.uiHeaderButton4.Name = "uiHeaderButton4";
this.uiHeaderButton4.Padding = new System.Windows.Forms.Padding(0, 5, 0, 3);
this.uiHeaderButton4.PageIndex = 0;
this.uiHeaderButton4.Radius = 0;
this.uiHeaderButton4.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
this.uiHeaderButton4.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.None;
this.uiHeaderButton4.Size = new System.Drawing.Size(100, 86);
this.uiHeaderButton4.Style = Sunny.UI.UIStyle.Custom;
this.uiHeaderButton4.StyleCustomMode = true;
this.uiHeaderButton4.Symbol = 0;
this.uiHeaderButton4.SymbolColor = System.Drawing.Color.White;
this.uiHeaderButton4.SymbolOffset = new System.Drawing.Point(0, 0);
this.uiHeaderButton4.TabIndex = 3;
this.uiHeaderButton4.Text = "手机";
//
// uiHeaderButton5
//
this.uiHeaderButton5.CircleColor = System.Drawing.Color.Bisque;
this.uiHeaderButton5.CircleSize = 50;
this.uiHeaderButton5.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiHeaderButton5.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(37)))), ((int)(((byte)(40)))), ((int)(((byte)(43)))));
this.uiHeaderButton5.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
this.uiHeaderButton5.FillPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.uiHeaderButton5.FillSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.uiHeaderButton5.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiHeaderButton5.ForeHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(130)))), ((int)(((byte)(130)))));
this.uiHeaderButton5.ForePressColor = System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(130)))), ((int)(((byte)(130)))));
this.uiHeaderButton5.ForeSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(130)))), ((int)(((byte)(130)))));
this.uiHeaderButton5.Image = global::Sunny.UI.Demo.Properties.Resources._3;
this.uiHeaderButton5.ImageTop = 0;
this.uiHeaderButton5.Location = new System.Drawing.Point(316, 1);
this.uiHeaderButton5.MinimumSize = new System.Drawing.Size(1, 1);
this.uiHeaderButton5.Name = "uiHeaderButton5";
this.uiHeaderButton5.Padding = new System.Windows.Forms.Padding(0, 5, 0, 3);
this.uiHeaderButton5.PageIndex = 0;
this.uiHeaderButton5.Radius = 0;
this.uiHeaderButton5.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
this.uiHeaderButton5.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.None;
this.uiHeaderButton5.Size = new System.Drawing.Size(100, 86);
this.uiHeaderButton5.Style = Sunny.UI.UIStyle.Custom;
this.uiHeaderButton5.StyleCustomMode = true;
this.uiHeaderButton5.Symbol = 0;
this.uiHeaderButton5.SymbolColor = System.Drawing.Color.White;
this.uiHeaderButton5.SymbolOffset = new System.Drawing.Point(0, 0);
this.uiHeaderButton5.TabIndex = 2;
this.uiHeaderButton5.Text = "邮件";
//
// uiHeaderButton3
//
this.uiHeaderButton3.CircleColor = System.Drawing.Color.Bisque;
this.uiHeaderButton3.CircleSize = 50;
this.uiHeaderButton3.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiHeaderButton3.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(37)))), ((int)(((byte)(40)))), ((int)(((byte)(43)))));
this.uiHeaderButton3.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
this.uiHeaderButton3.FillPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.uiHeaderButton3.FillSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.uiHeaderButton3.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiHeaderButton3.ForeHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(130)))), ((int)(((byte)(130)))));
this.uiHeaderButton3.ForePressColor = System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(130)))), ((int)(((byte)(130)))));
this.uiHeaderButton3.ForeSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(130)))), ((int)(((byte)(130)))));
this.uiHeaderButton3.Image = global::Sunny.UI.Demo.Properties.Resources._2;
this.uiHeaderButton3.ImageTop = 0;
this.uiHeaderButton3.Location = new System.Drawing.Point(216, 1);
this.uiHeaderButton3.MinimumSize = new System.Drawing.Size(1, 1);
this.uiHeaderButton3.Name = "uiHeaderButton3";
this.uiHeaderButton3.Padding = new System.Windows.Forms.Padding(0, 5, 0, 3);
this.uiHeaderButton3.PageIndex = 0;
this.uiHeaderButton3.Radius = 0;
this.uiHeaderButton3.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
this.uiHeaderButton3.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.None;
this.uiHeaderButton3.Size = new System.Drawing.Size(100, 86);
this.uiHeaderButton3.Style = Sunny.UI.UIStyle.Custom;
this.uiHeaderButton3.StyleCustomMode = true;
this.uiHeaderButton3.Symbol = 0;
this.uiHeaderButton3.SymbolColor = System.Drawing.Color.White;
this.uiHeaderButton3.SymbolOffset = new System.Drawing.Point(0, 0);
this.uiHeaderButton3.TabIndex = 1;
this.uiHeaderButton3.Text = "消息";
//
// uiHeaderButton2
//
this.uiHeaderButton2.CircleColor = System.Drawing.Color.Bisque;
this.uiHeaderButton2.CircleSize = 50;
this.uiHeaderButton2.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiHeaderButton2.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(37)))), ((int)(((byte)(40)))), ((int)(((byte)(43)))));
this.uiHeaderButton2.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
this.uiHeaderButton2.FillPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.uiHeaderButton2.FillSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
this.uiHeaderButton2.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiHeaderButton2.ForeHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(130)))), ((int)(((byte)(130)))));
this.uiHeaderButton2.ForePressColor = System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(130)))), ((int)(((byte)(130)))));
this.uiHeaderButton2.ForeSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(130)))), ((int)(((byte)(130)))));
this.uiHeaderButton2.Image = global::Sunny.UI.Demo.Properties.Resources._1;
this.uiHeaderButton2.ImageTop = 0;
this.uiHeaderButton2.Location = new System.Drawing.Point(116, 1);
this.uiHeaderButton2.MinimumSize = new System.Drawing.Size(1, 1);
this.uiHeaderButton2.Name = "uiHeaderButton2";
this.uiHeaderButton2.Padding = new System.Windows.Forms.Padding(0, 5, 0, 3);
this.uiHeaderButton2.PageIndex = 0;
this.uiHeaderButton2.Radius = 0;
this.uiHeaderButton2.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
this.uiHeaderButton2.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.None;
this.uiHeaderButton2.Size = new System.Drawing.Size(100, 86);
this.uiHeaderButton2.Style = Sunny.UI.UIStyle.Custom;
this.uiHeaderButton2.StyleCustomMode = true;
this.uiHeaderButton2.Symbol = 0;
this.uiHeaderButton2.SymbolColor = System.Drawing.Color.White;
this.uiHeaderButton2.SymbolOffset = new System.Drawing.Point(0, 0);
this.uiHeaderButton2.TabIndex = 0;
this.uiHeaderButton2.Text = "主页";
//
// FHeaderButton
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(837, 536);
this.Name = "FHeaderButton";
this.Symbol = 62141;
this.Text = "HeaderButton";
this.Load += new System.EventHandler(this.FHeaderButton_Load);
this.PagePanel.ResumeLayout(false);
this.uiPanel1.ResumeLayout(false);
this.uiPanel2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private UIPanel uiPanel1;
private UI.Controls.UIHeaderButton uiHeaderButton1;
private UIPanel uiPanel2;
private UI.Controls.UIHeaderButton uiHeaderButton2;
private UI.Controls.UIHeaderButton uiHeaderButton3;
private UI.Controls.UIHeaderButton uiHeaderButton6;
private UI.Controls.UIHeaderButton uiHeaderButton7;
private UI.Controls.UIHeaderButton uiHeaderButton4;
private UI.Controls.UIHeaderButton uiHeaderButton5;
private UI.Controls.UIHeaderButton uiHeaderButton12;
private UI.Controls.UIHeaderButton uiHeaderButton11;
private UI.Controls.UIHeaderButton uiHeaderButton10;
private UI.Controls.UIHeaderButton uiHeaderButton9;
private UI.Controls.UIHeaderButton uiHeaderButton8;
}
}

View File

@ -0,0 +1,17 @@
using System;
namespace Sunny.UI.Demo
{
public partial class FHeaderButton : UITitlePage
{
public FHeaderButton()
{
InitializeComponent();
}
private void FHeaderButton_Load(object sender, EventArgs e)
{
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<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="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -17,6 +17,7 @@ namespace Sunny.UI.Demo
TreeNode parent = Aside.CreateNode("Controls", 61451, 24, pageIndex);
//通过设置PageIndex关联
Aside.CreateChildNode(parent, 61640, 24, AddPage(new FButton(), ++pageIndex));
Aside.CreateChildNode(parent, 62141, 24, AddPage(new FHeaderButton(), ++pageIndex));
Aside.CreateChildNode(parent, 61490, 24, AddPage(new FLabel(), ++pageIndex));
Aside.CreateChildNode(parent, 61770, 24, AddPage(new FCheckBox(), ++pageIndex));
Aside.CreateChildNode(parent, 61842, 24, AddPage(new FRadioButton(), ++pageIndex));

View File

@ -60,6 +60,96 @@ namespace Sunny.UI.Demo.Properties {
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap _1 {
get {
object obj = ResourceManager.GetObject("_1", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap _2 {
get {
object obj = ResourceManager.GetObject("_2", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap _3 {
get {
object obj = ResourceManager.GetObject("_3", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap _4 {
get {
object obj = ResourceManager.GetObject("_4", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap _5 {
get {
object obj = ResourceManager.GetObject("_5", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap _6 {
get {
object obj = ResourceManager.GetObject("_6", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap _7 {
get {
object obj = ResourceManager.GetObject("_7", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap _8 {
get {
object obj = ResourceManager.GetObject("_8", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap _9 {
get {
object obj = ResourceManager.GetObject("_9", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>

View File

@ -271,4 +271,31 @@
<data name="zaragoza" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\zaragoza.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="_1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="_2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="_3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="_4" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\4.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="_5" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\5.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="_6" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\6.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="_7" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\7.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="_8" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\8.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="_9" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\9.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -207,6 +207,12 @@
<Compile Include="Controls\FTreeView.Designer.cs">
<DependentUpon>FTreeView.cs</DependentUpon>
</Compile>
<Compile Include="Controls\FHeaderButton.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Controls\FHeaderButton.Designer.cs">
<DependentUpon>FHeaderButton.cs</DependentUpon>
</Compile>
<Compile Include="FMain.cs">
<SubType>Form</SubType>
</Compile>
@ -353,6 +359,9 @@
<EmbeddedResource Include="Controls\FFlowLayoutPanel.resx">
<DependentUpon>FFlowLayoutPanel.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\FHeaderButton.resx">
<DependentUpon>FHeaderButton.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\FLabel.resx">
<DependentUpon>FLabel.cs</DependentUpon>
</EmbeddedResource>
@ -623,6 +632,15 @@
<None Include="Resources\zaragoza.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\1.png" />
<None Include="Resources\2.png" />
<None Include="Resources\3.png" />
<None Include="Resources\4.png" />
<None Include="Resources\5.png" />
<None Include="Resources\6.png" />
<None Include="Resources\7.png" />
<None Include="Resources\8.png" />
<None Include="Resources\9.png" />
<Content Include="SunnyUI.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

View File

@ -0,0 +1,428 @@
/******************************************************************************
* SunnyUI
* CopyRight (C) 2012-2020 ShenYongHua().
* QQ群56829229 QQ17612584 EMailSunnyUI@qq.com
*
* Blog: https://www.cnblogs.com/yhuse
* Gitee: https://gitee.com/yhuse/SunnyUI
* GitHub: https://github.com/yhuse/SunnyUI
*
* SunnyUI.dll can be used for free under the GPL-3.0 license.
* If you use this code, please keep this note.
* 使
******************************************************************************
* : UIHeaderButton.cs
* :
* : V3.0
* : 2021-02-10
*
* 2021-02-10: V3.0.1
******************************************************************************/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Design;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
namespace Sunny.UI.Controls
{
[DefaultEvent("Click")]
[DefaultProperty("Text")]
public class UIHeaderButton : UIControl, IButtonControl
{
public UIHeaderButton()
{
Size = new Size(100, 88);
ShowText = false;
ShowRect = false;
Radius = 0;
RadiusSides = UICornerRadiusSides.None;
RectSides = ToolStripStatusLabelBorderSides.None;
Padding = new Padding(0, 8, 0, 3);
foreHoverColor = UIStyles.Blue.ButtonForeHoverColor;
forePressColor = UIStyles.Blue.ButtonForePressColor;
foreSelectedColor = UIStyles.Blue.ButtonForeSelectedColor;
fillHoverColor = UIStyles.Blue.ButtonFillHoverColor;
fillPressColor = UIStyles.Blue.ButtonFillPressColor;
fillSelectedColor = UIStyles.Blue.ButtonFillSelectedColor;
SetStyle(ControlStyles.StandardDoubleClick, UseDoubleClick);
}
private bool isClick;
public void PerformClick()
{
if (isClick) return;
if (CanSelect && Enabled)
{
isClick = true;
OnClick(EventArgs.Empty);
isClick = false;
}
}
protected override void OnClick(EventArgs e)
{
Focus();
List<UIHeaderButton> buttons = Parent.GetControls<UIHeaderButton>();
foreach (var button in buttons)
{
button.Selected = false;
}
Selected = true;
TabControl?.SelectPage(PageIndex);
base.OnClick(e);
}
private int _symbolSize = 48;
[DefaultValue(48)]
[Description("字体图标大小"), Category("SunnyUI")]
public int SymbolSize
{
get => _symbolSize;
set
{
_symbolSize = Math.Max(value, 16);
_symbolSize = Math.Min(value, 64);
Invalidate();
}
}
[DefaultValue(0)]
[Description("多页面框架的页面索引"), Category("SunnyUI")]
public int PageIndex { get; set; }
public Color symbolColor = Color.White;
[DefaultValue(typeof(Color), "White")]
[Description("字体图标颜色"), Category("SunnyUI")]
public Color SymbolColor
{
get => symbolColor;
set
{
symbolColor = value;
Invalidate();
}
}
public override void SetStyleColor(UIBaseStyle uiColor)
{
base.SetStyleColor(uiColor);
if (uiColor.IsCustom()) return;
fillHoverColor = uiColor.ButtonFillHoverColor;
foreHoverColor = uiColor.ButtonForeHoverColor;
fillPressColor = uiColor.ButtonFillPressColor;
forePressColor = uiColor.ButtonForePressColor;
fillSelectedColor = uiColor.ButtonFillSelectedColor;
foreSelectedColor = uiColor.ButtonForeSelectedColor;
Invalidate();
}
/// <summary>
/// 填充颜色,当值为背景色或透明色或空值则不填充
/// </summary>
[Description("填充颜色"), Category("SunnyUI")]
[DefaultValue(typeof(Color), "80, 160, 255")]
public Color FillColor
{
get => fillColor;
set => SetFillColor(value);
}
/// <summary>
/// 字体颜色
/// </summary>
[Description("字体颜色"), Category("SunnyUI")]
[DefaultValue(typeof(Color), "White")]
public override Color ForeColor
{
get => foreColor;
set => SetForeColor(value);
}
[DefaultValue(typeof(Color), "244, 244, 244"), Category("SunnyUI")]
[Description("不可用时填充颜色")]
public Color FillDisableColor
{
get => fillDisableColor;
set => SetFillDisableColor(value);
}
[DefaultValue(typeof(Color), "109, 109, 103"), Category("SunnyUI")]
[Description("不可用时字体颜色")]
public Color ForeDisableColor
{
get => foreDisableColor;
set => SetForeDisableColor(value);
}
[DefaultValue(typeof(Color), "111, 168, 255"), Category("SunnyUI")]
[Description("鼠标移上时填充颜色")]
public Color FillHoverColor
{
get => fillHoverColor;
set => SetFillHoveColor(value);
}
[DefaultValue(typeof(Color), "74, 131, 229"), Category("SunnyUI")]
[Description("鼠标按下时填充颜色")]
public Color FillPressColor
{
get => fillPressColor;
set => SetFillPressColor(value);
}
[DefaultValue(typeof(Color), "White"), Category("SunnyUI")]
[Description("鼠标移上时字体颜色")]
public Color ForeHoverColor
{
get => foreHoverColor;
set => SetForeHoveColor(value);
}
[DefaultValue(typeof(Color), "White"), Category("SunnyUI")]
[Description("鼠标按下时字体颜色")]
public Color ForePressColor
{
get => forePressColor;
set => SetForePressColor(value);
}
[DefaultValue(typeof(Color), "74, 131, 229"), Category("SunnyUI")]
[Description("选中时填充颜色")]
public Color FillSelectedColor
{
get => fillSelectedColor;
set => SetFillSelectedColor(value);
}
[DefaultValue(typeof(Color), "White"), Category("SunnyUI")]
[Description("选中时字体颜色")]
public Color ForeSelectedColor
{
get => foreSelectedColor;
set => SetForeSelectedColor(value);
}
[DefaultValue(null)]
[Description("图片"), Category("SunnyUI")]
public Image Image { get; set; }
private int _symbol = FontAwesomeIcons.fa_check;
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
[Editor(typeof(UIImagePropertyEditor), typeof(UITypeEditor))]
[DefaultValue(61452)]
[Description("字体图标"), Category("SunnyUI")]
public int Symbol
{
get => _symbol;
set
{
_symbol = value;
Invalidate();
}
}
private int imageTop;
[DefaultValue(0)]
[Description("图片距离顶部距离"), Category("SunnyUI")]
public int ImageTop
{
get => imageTop;
set
{
imageTop = value;
Invalidate();
}
}
private Point symbolOffset = new Point(0, 0);
[DefaultValue(typeof(Point), "0, 0")]
[Description("字体图标的偏移位置"), Category("SunnyUI")]
public Point SymbolOffset
{
get => symbolOffset;
set
{
symbolOffset = value;
Invalidate();
}
}
private Color circleColor = Color.Bisque;
[DefaultValue(typeof(Color), "Bisque")]
[Description("字体图标背景颜色"), Category("SunnyUI")]
public Color CircleColor
{
get => circleColor;
set
{
circleColor = value;
Invalidate();
}
}
protected override void OnPaddingChanged(EventArgs e)
{
base.OnPaddingChanged(e);
Invalidate();
}
private int circleSize = 50;
[DefaultValue(50)]
[Description("字体图标背景大小"), Category("SunnyUI")]
public int CircleSize
{
get => circleSize;
set
{
circleSize = value;
Invalidate();
}
}
protected override void OnPaintFill(Graphics g, GraphicsPath path)
{
if (!selected)
{
Color color = GetFillColor();
g.Clear(color);
}
else
{
g.Clear(fillSelectedColor);
}
}
/// <summary>
/// 是否选中
/// </summary>
[DefaultValue(false)]
[Description("是否选中"), Category("SunnyUI")]
public bool Selected
{
get => selected;
set
{
if (selected != value)
{
selected = value;
Invalidate();
}
}
}
protected override void OnMouseDown(MouseEventArgs e)
{
base.OnMouseDown(e);
IsPress = true;
Invalidate();
}
protected override void OnMouseUp(MouseEventArgs e)
{
base.OnMouseUp(e);
IsPress = false;
Invalidate();
}
protected override void OnMouseLeave(EventArgs e)
{
base.OnMouseLeave(e);
IsPress = false;
IsHover = false;
Invalidate();
}
protected override void OnMouseEnter(EventArgs e)
{
base.OnMouseEnter(e);
IsHover = true;
Invalidate();
}
public void NotifyDefault(bool value)
{
}
[DefaultValue(DialogResult.None)]
[Description("指定标识符以指示对话框的返回值"), Category("SunnyUI")]
public DialogResult DialogResult { get; set; } = DialogResult.None;
protected override void OnKeyDown(KeyEventArgs e)
{
if (Focused && e.KeyCode == Keys.Space)
{
IsPress = true;
Invalidate();
PerformClick();
}
base.OnKeyDown(e);
}
protected override void OnKeyUp(KeyEventArgs e)
{
IsPress = false;
Invalidate();
base.OnKeyUp(e);
}
protected override void OnPaint(PaintEventArgs e)
{
//重绘父类
base.OnPaint(e);
SizeF ImageSize = new SizeF(0, 0);
if (Symbol > 0)
ImageSize = e.Graphics.GetFontImageSize(Symbol, SymbolSize);
if (Image != null)
ImageSize = Image.Size;
//字体图标
if (Symbol > 0 && Image == null)
{
e.Graphics.FillEllipse(CircleColor, (Width - CircleSize) / 2.0f, Padding.Top, CircleSize, CircleSize);
e.Graphics.DrawFontImage(Symbol, SymbolSize, SymbolColor,
new RectangleF(
symbolOffset.X + (Width - CircleSize) / 2.0f,
symbolOffset.Y + Padding.Top,
CircleSize,
CircleSize));
}
else if (Image != null)
{
e.Graphics.DrawImage(Image, (Width - ImageSize.Width) / 2.0f, ImageTop, ImageSize.Width, ImageSize.Height);
}
Color color = GetForeColor();
SizeF sf = e.Graphics.MeasureString(Text, Font);
e.Graphics.DrawString(Text, Font, color, (Width - sf.Width) / 2, Height - Padding.Bottom - sf.Height);
}
[DefaultValue(null)]
[Description("关联的TabControl"), Category("SunnyUI")]
public UITabControl TabControl { get; set; }
}
}