全新界面,引入Menu+Tabs形式显示示例

This commit is contained in:
czz_y
2025-01-15 17:06:57 +08:00
parent d76d262152
commit 5f5e6603f4
10 changed files with 266 additions and 148 deletions
+107 -100
View File
@@ -30,7 +30,15 @@
{
this.header1 = new AntdUI.PageHeader();
this.stackPanel1 = new AntdUI.StackPanel();
this.stackPanel2 = new AntdUI.StackPanel();
this.stackPanel8 = new AntdUI.StackPanel();
this.switch_enabled = new AntdUI.Switch();
this.label18 = new AntdUI.Label();
this.colorPicker = new AntdUI.ColorPicker();
this.label16 = new AntdUI.Label();
this.stackPanel6 = new AntdUI.StackPanel();
this.switch_loading = new AntdUI.Switch();
this.label2 = new AntdUI.Label();
this.input_badgesize = new AntdUI.InputNumber();
this.label15 = new AntdUI.Label();
this.input_badge = new AntdUI.Input();
@@ -62,24 +70,17 @@
this.label10 = new AntdUI.Label();
this.label4 = new AntdUI.Label();
this.label3 = new AntdUI.Label();
this.stackPanel8 = new AntdUI.StackPanel();
this.stackPanel2 = new AntdUI.StackPanel();
this.buttonOpen = new AntdUI.Button();
this.buttonCZ = new AntdUI.Button();
this.buttonClose = new AntdUI.Button();
this.colorPicker = new AntdUI.ColorPicker();
this.label16 = new AntdUI.Label();
this.switch_loading = new AntdUI.Switch();
this.label2 = new AntdUI.Label();
this.switch_enabled = new AntdUI.Switch();
this.label18 = new AntdUI.Label();
this.stackPanel1.SuspendLayout();
this.stackPanel2.SuspendLayout();
this.stackPanel8.SuspendLayout();
this.stackPanel6.SuspendLayout();
this.stackPanel5.SuspendLayout();
this.stackPanel7.SuspendLayout();
this.stackPanel4.SuspendLayout();
this.stackPanel3.SuspendLayout();
this.stackPanel8.SuspendLayout();
this.stackPanel2.SuspendLayout();
this.SuspendLayout();
//
// header1
@@ -115,6 +116,67 @@
this.stackPanel1.Text = "stackPanel1";
this.stackPanel1.Vertical = true;
//
// stackPanel2
//
this.stackPanel2.Controls.Add(this.buttonCZ);
this.stackPanel2.Controls.Add(this.buttonClose);
this.stackPanel2.Controls.Add(this.buttonOpen);
this.stackPanel2.Location = new System.Drawing.Point(3, 291);
this.stackPanel2.Name = "stackPanel2";
this.stackPanel2.Size = new System.Drawing.Size(744, 38);
this.stackPanel2.TabIndex = 28;
this.stackPanel2.Text = "stackPanel2";
//
// stackPanel8
//
this.stackPanel8.Controls.Add(this.switch_enabled);
this.stackPanel8.Controls.Add(this.label18);
this.stackPanel8.Controls.Add(this.colorPicker);
this.stackPanel8.Controls.Add(this.label16);
this.stackPanel8.Gap = 4;
this.stackPanel8.Location = new System.Drawing.Point(3, 253);
this.stackPanel8.Name = "stackPanel8";
this.stackPanel8.Size = new System.Drawing.Size(744, 32);
this.stackPanel8.TabIndex = 27;
this.stackPanel8.Text = "stackPanel8";
//
// switch_enabled
//
this.switch_enabled.Location = new System.Drawing.Point(292, 3);
this.switch_enabled.Name = "switch_enabled";
this.switch_enabled.Size = new System.Drawing.Size(50, 26);
this.switch_enabled.TabIndex = 32;
this.switch_enabled.Text = "switch1";
//
// label18
//
this.label18.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label18.Location = new System.Drawing.Point(190, 3);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(92, 26);
this.label18.TabIndex = 31;
this.label18.Text = "Enabled";
//
// colorPicker
//
this.colorPicker.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
this.colorPicker.Location = new System.Drawing.Point(105, 3);
this.colorPicker.Name = "colorPicker";
this.colorPicker.Size = new System.Drawing.Size(75, 26);
this.colorPicker.TabIndex = 30;
this.colorPicker.Text = "colorPicker1";
this.colorPicker.Value = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(119)))), ((int)(((byte)(255)))));
this.colorPicker.WaveSize = 0;
//
// label16
//
this.label16.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label16.Location = new System.Drawing.Point(3, 3);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(92, 26);
this.label16.TabIndex = 29;
this.label16.Text = "BadgeBack";
//
// stackPanel6
//
this.stackPanel6.Controls.Add(this.switch_loading);
@@ -130,6 +192,23 @@
this.stackPanel6.TabIndex = 25;
this.stackPanel6.Text = "stackPanel6";
//
// switch_loading
//
this.switch_loading.Location = new System.Drawing.Point(492, 3);
this.switch_loading.Name = "switch_loading";
this.switch_loading.Size = new System.Drawing.Size(50, 26);
this.switch_loading.TabIndex = 30;
this.switch_loading.Text = "switch1";
//
// label2
//
this.label2.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(390, 3);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(92, 26);
this.label2.TabIndex = 29;
this.label2.Text = "Loading";
//
// input_badgesize
//
this.input_badgesize.DecimalPlaces = 2;
@@ -195,7 +274,6 @@
//
// switch_round
//
this.switch_round.AutoCheck = true;
this.switch_round.Location = new System.Drawing.Point(492, 3);
this.switch_round.Name = "switch_round";
this.switch_round.Size = new System.Drawing.Size(50, 26);
@@ -325,7 +403,6 @@
//
// switch_topmost
//
this.switch_topmost.AutoCheck = true;
this.switch_topmost.Checked = true;
this.switch_topmost.Location = new System.Drawing.Point(492, 3);
this.switch_topmost.Name = "switch_topmost";
@@ -417,7 +494,6 @@
//
// switch_vertical
//
this.switch_vertical.AutoCheck = true;
this.switch_vertical.Checked = true;
this.switch_vertical.Location = new System.Drawing.Point(492, 3);
this.switch_vertical.Name = "switch_vertical";
@@ -502,36 +578,24 @@
this.label3.TabIndex = 4;
this.label3.Text = "FloatButton没有工具箱控件,使用代码方式调用。";
//
// stackPanel8
// buttonOpen
//
this.stackPanel8.Controls.Add(this.switch_enabled);
this.stackPanel8.Controls.Add(this.label18);
this.stackPanel8.Controls.Add(this.colorPicker);
this.stackPanel8.Controls.Add(this.label16);
this.stackPanel8.Gap = 4;
this.stackPanel8.Location = new System.Drawing.Point(3, 253);
this.stackPanel8.Name = "stackPanel8";
this.stackPanel8.Size = new System.Drawing.Size(744, 32);
this.stackPanel8.TabIndex = 27;
this.stackPanel8.Text = "stackPanel8";
//
// stackPanel2
//
this.stackPanel2.Controls.Add(this.buttonCZ);
this.stackPanel2.Controls.Add(this.buttonClose);
this.stackPanel2.Location = new System.Drawing.Point(3, 291);
this.stackPanel2.Name = "stackPanel2";
this.stackPanel2.Size = new System.Drawing.Size(744, 38);
this.stackPanel2.TabIndex = 28;
this.stackPanel2.Text = "stackPanel2";
this.buttonOpen.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonOpen.Location = new System.Drawing.Point(3, 3);
this.buttonOpen.Name = "buttonOpen";
this.buttonOpen.Size = new System.Drawing.Size(75, 32);
this.buttonOpen.TabIndex = 5;
this.buttonOpen.Text = "打 开";
this.buttonOpen.Type = AntdUI.TTypeMini.Success;
this.buttonOpen.WaveSize = 0;
//
// buttonCZ
//
this.buttonCZ.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonCZ.Location = new System.Drawing.Point(84, 3);
this.buttonCZ.Location = new System.Drawing.Point(165, 3);
this.buttonCZ.Name = "buttonCZ";
this.buttonCZ.Size = new System.Drawing.Size(75, 32);
this.buttonCZ.TabIndex = 4;
this.buttonCZ.TabIndex = 7;
this.buttonCZ.Text = "重 置";
this.buttonCZ.Type = AntdUI.TTypeMini.Warn;
this.buttonCZ.WaveSize = 0;
@@ -539,71 +603,14 @@
// buttonClose
//
this.buttonClose.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonClose.Location = new System.Drawing.Point(3, 3);
this.buttonClose.Location = new System.Drawing.Point(84, 3);
this.buttonClose.Name = "buttonClose";
this.buttonClose.Size = new System.Drawing.Size(75, 32);
this.buttonClose.TabIndex = 3;
this.buttonClose.TabIndex = 6;
this.buttonClose.Text = "关 闭";
this.buttonClose.Type = AntdUI.TTypeMini.Error;
this.buttonClose.WaveSize = 0;
//
// colorPicker
//
this.colorPicker.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
this.colorPicker.Location = new System.Drawing.Point(105, 3);
this.colorPicker.Name = "colorPicker";
this.colorPicker.ShowText = true;
this.colorPicker.Size = new System.Drawing.Size(75, 26);
this.colorPicker.TabIndex = 30;
this.colorPicker.Text = "colorPicker1";
this.colorPicker.Value = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(119)))), ((int)(((byte)(255)))));
this.colorPicker.WaveSize = 0;
//
// label16
//
this.label16.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label16.Location = new System.Drawing.Point(3, 3);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(92, 26);
this.label16.TabIndex = 29;
this.label16.Text = "BadgeBack";
//
// switch_loading
//
this.switch_loading.AutoCheck = true;
this.switch_loading.Location = new System.Drawing.Point(492, 3);
this.switch_loading.Name = "switch_loading";
this.switch_loading.Size = new System.Drawing.Size(50, 26);
this.switch_loading.TabIndex = 30;
this.switch_loading.Text = "switch1";
//
// label2
//
this.label2.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(390, 3);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(92, 26);
this.label2.TabIndex = 29;
this.label2.Text = "Loading";
//
// switch_enabled
//
this.switch_enabled.AutoCheck = true;
this.switch_enabled.Location = new System.Drawing.Point(292, 3);
this.switch_enabled.Name = "switch_enabled";
this.switch_enabled.Size = new System.Drawing.Size(50, 26);
this.switch_enabled.TabIndex = 32;
this.switch_enabled.Text = "switch1";
//
// label18
//
this.label18.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label18.Location = new System.Drawing.Point(190, 3);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(92, 26);
this.label18.TabIndex = 31;
this.label18.Text = "Enabled";
//
// FloatButtonDemo
//
this.Controls.Add(this.stackPanel1);
@@ -611,15 +618,14 @@
this.Controls.Add(this.header1);
this.Name = "FloatButtonDemo";
this.Size = new System.Drawing.Size(750, 492);
this.Load += new System.EventHandler(this.FloatButtonDemo_Load);
this.stackPanel1.ResumeLayout(false);
this.stackPanel2.ResumeLayout(false);
this.stackPanel8.ResumeLayout(false);
this.stackPanel6.ResumeLayout(false);
this.stackPanel5.ResumeLayout(false);
this.stackPanel7.ResumeLayout(false);
this.stackPanel4.ResumeLayout(false);
this.stackPanel3.ResumeLayout(false);
this.stackPanel8.ResumeLayout(false);
this.stackPanel2.ResumeLayout(false);
this.ResumeLayout(false);
}
@@ -661,8 +667,6 @@
private AntdUI.Select select_type;
private AntdUI.Label label13;
private AntdUI.StackPanel stackPanel2;
private AntdUI.Button buttonCZ;
private AntdUI.Button buttonClose;
private AntdUI.StackPanel stackPanel8;
private AntdUI.Switch switch_enabled;
private AntdUI.Label label18;
@@ -670,5 +674,8 @@
private AntdUI.Label label16;
private AntdUI.Switch switch_loading;
private AntdUI.Label label2;
private AntdUI.Button buttonCZ;
private AntdUI.Button buttonClose;
private AntdUI.Button buttonOpen;
}
}
+6 -6
View File
@@ -21,14 +21,9 @@ namespace AntdUIDemo.Views
BindEventHandler();
}
private void FloatButtonDemo_Load(object sender, EventArgs e)
{
// 加载浮动按钮
LoadFloatButton();
}
private void BindEventHandler()
{
buttonOpen.Click += ButtonOpen_Click;
buttonClose.Click += buttonClose_Click;
buttonCZ.Click += buttonCZ_Click;
@@ -53,6 +48,11 @@ namespace AntdUIDemo.Views
colorPicker.ValueChanged += colorPicker_ValueChanged;
}
private void ButtonOpen_Click(object sender, EventArgs e)
{
LoadFloatButton();
}
// 初始化下拉框
private void InitSelectItems()
{
+2 -5
View File
@@ -124,7 +124,7 @@
// tabs1
//
this.tabs1.Centered = true;
this.tabs1.Cursor = System.Windows.Forms.Cursors.Default;
this.tabs1.Cursor = System.Windows.Forms.Cursors.Hand;
this.tabs1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabs1.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.tabs1.Gap = 12;
@@ -151,7 +151,6 @@
//
// menu_inline
//
this.menu_inline.AutoCollapse = true;
this.menu_inline.Dock = System.Windows.Forms.DockStyle.Left;
this.menu_inline.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.menu_inline.Indent = true;
@@ -213,7 +212,6 @@
//
// menu_vertical
//
this.menu_vertical.AutoCollapse = true;
this.menu_vertical.Dock = System.Windows.Forms.DockStyle.Left;
this.menu_vertical.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.menu_vertical.Indent = true;
@@ -259,7 +257,7 @@
this.menu_vertical.Location = new System.Drawing.Point(9, 9);
this.menu_vertical.Mode = AntdUI.TMenuMode.Vertical;
this.menu_vertical.Name = "menu_vertical";
this.menu_vertical.Size = new System.Drawing.Size(164, 418);
this.menu_vertical.Size = new System.Drawing.Size(185, 418);
this.menu_vertical.TabIndex = 5;
this.menu_vertical.Text = "menu1";
//
@@ -276,7 +274,6 @@
//
// menu_horizontal
//
this.menu_horizontal.AutoCollapse = true;
this.menu_horizontal.Dock = System.Windows.Forms.DockStyle.Top;
this.menu_horizontal.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.menu_horizontal.Indent = true;