升级1.8.9,新增Tour

This commit is contained in:
czz_y 2025-02-24 17:34:37 +08:00
parent 48901537fe
commit 13e13109fe
16 changed files with 755 additions and 34 deletions

View File

@ -13,7 +13,7 @@
<Copyright>Copyright © 2025 czz_y</Copyright>
<FileVersion>$(Version)</FileVersion>
<AssemblyVersion>$(Version)</AssemblyVersion>
<Version>1.8.6</Version>
<Version>1.8.9</Version>
<Authors>czz_y</Authors>
<Description>基于 Winform UI 框架 AntdUI 设计的 Demo</Description>
<PackageProjectUrl>https://gitee.com/mubaiyanghua/antd-uidemo</PackageProjectUrl>
@ -30,7 +30,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="AntdUI" Version="1.8.6" />
<PackageReference Include="AntdUI" Version="1.8.9" />
<PackageReference Include="Costura.Fody" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

11
MainWindow.Designer.cs generated
View File

@ -29,7 +29,7 @@
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainWindow));
AntdUI.Tabs.StyleCard styleCard1 = new AntdUI.Tabs.StyleCard();
AntdUI.Tabs.StyleCard styleCard2 = new AntdUI.Tabs.StyleCard();
this.titlebar = new AntdUI.PageHeader();
this.input_search = new AntdUI.Input();
this.dropdown_translate = new AntdUI.Dropdown();
@ -63,7 +63,7 @@
this.titlebar.Size = new System.Drawing.Size(1024, 40);
this.titlebar.SubText = "Demo";
this.titlebar.TabIndex = 0;
this.titlebar.Text = "AntdUI 1.8.6";
this.titlebar.Text = "AntdUI 1.8.9";
//
// input_search
//
@ -146,15 +146,15 @@
//
// tabs
//
this.tabs.Cursor = System.Windows.Forms.Cursors.Hand;
this.tabs.Cursor = System.Windows.Forms.Cursors.Default;
this.tabs.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabs.Gap = 20;
this.tabs.Location = new System.Drawing.Point(70, 40);
this.tabs.Name = "tabs";
this.tabs.Pages.Add(this.tabPage);
this.tabs.Size = new System.Drawing.Size(954, 560);
styleCard1.Closable = true;
this.tabs.Style = styleCard1;
styleCard2.Closable = true;
this.tabs.Style = styleCard2;
this.tabs.TabIndex = 9;
this.tabs.Type = AntdUI.TabType.Card;
//
@ -187,6 +187,7 @@
this.menu.IconRatio = 1F;
this.menu.Indent = true;
this.menu.Location = new System.Drawing.Point(0, 40);
this.menu.Margin = new System.Windows.Forms.Padding(3, 3, 0, 3);
this.menu.Name = "menu";
this.menu.Size = new System.Drawing.Size(70, 560);
this.menu.TabIndex = 8;

View File

@ -103,6 +103,8 @@ namespace AntdUIDemo
{
tabs.Pages.RemoveRange(1, tabs.Pages.Count - 1); // 从索引1开始移除后面的所有页面
}
menu.Select(null);
menu.Refresh();
}
}, menulist);
@ -430,6 +432,9 @@ namespace AntdUIDemo
case "Tooltip":
control = new TooltipDemo();
break;
case "Tour":
control = new TourDemo(this);
break;
case "Tree":
control = new TreeDemo();
break;

View File

@ -68,6 +68,7 @@ namespace AntdUIDemo.Models
new MenuItems { Text = "Tag 标签", Tag = "Tag"},
new MenuItems { Text = "Timeline 时间轴", Tag = "Timeline"},
new MenuItems { Text = "Tooltip 文字提示", Tag = "Tooltip"},
new MenuItems { Text = "Tour 漫游式引导" , Tag = "Tour"},
new MenuItems { Text = "Tree 树形控件", Tag = "Tree"}
}
},
@ -126,6 +127,7 @@ namespace AntdUIDemo.Models
new MenuItems { Text = "FlowPanel", Tag = "FlowPanel"},
new MenuItems { Text = "GridPanel", Tag = "GridPanel"},
new MenuItems { Text = "Panel", Tag = "Panel"},
new MenuItems { Text = "Splitter ", Tag = "Splitter"},
new MenuItems { Text = "StackPanel", Tag = "StackPanel"}
}
},
@ -174,6 +176,7 @@ namespace AntdUIDemo.Models
new MenuItems { Text = "Tag", Tag = "Tag"},
new MenuItems { Text = "Timeline", Tag = "Timeline"},
new MenuItems { Text = "Tooltip", Tag = "Tooltip"},
new MenuItems { Text = "Tour" , Tag = "Tour"},
new MenuItems { Text = "Tree", Tag = "Tree"}
}
},

View File

@ -4,7 +4,7 @@
<h1>AntdUI Demo</h1>
This project is developed based on `Winform .NET Framework 4.8`, and is a demo project of [AntdUI](https://gitee.com/antdui/AntdUI), the current version is `1.8.6`
This project is developed based on `Winform .NET Framework 4.8`, and is a demo project of [AntdUI](https://gitee.com/antdui/AntdUI), the current version is `1.8.9`
</div>

View File

@ -4,7 +4,7 @@
<h1>AntdUI Demo</h1>
本项目基于 `Winform .NET Framework 4.8` 开发,是 [AntdUI](https://gitee.com/antdui/AntdUI) 的 Demo 项目,当前版本 `1.8.6`
本项目基于 `Winform .NET Framework 4.8` 开发,是 [AntdUI](https://gitee.com/antdui/AntdUI) 的 Demo 项目,当前版本 `1.8.9`
</div>

View File

@ -33,6 +33,7 @@
this.stackPanel2 = new AntdUI.StackPanel();
this.gridPanel = new AntdUI.GridPanel();
this.stackPanel3 = new AntdUI.StackPanel();
this.label1 = new AntdUI.Label();
this.buttonCZ = new AntdUI.Button();
this.stackPanel4 = new AntdUI.StackPanel();
this.input_gap = new AntdUI.InputNumber();
@ -40,7 +41,6 @@
this.stackPanel5 = new AntdUI.StackPanel();
this.input_span = new AntdUI.Input();
this.label3 = new AntdUI.Label();
this.label1 = new AntdUI.Label();
this.stackPanel1.SuspendLayout();
this.stackPanel2.SuspendLayout();
this.stackPanel3.SuspendLayout();
@ -104,6 +104,15 @@
this.stackPanel3.Text = "stackPanel3";
this.stackPanel3.Vertical = true;
//
// label1
//
this.label1.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(3, 136);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(244, 120);
this.label1.TabIndex = 21;
this.label1.Text = "Span以-符号分界。\r\n-前为列宽属性,列宽以 ; 分组,每一组代表一行。\r\n-后为行高属性。\r\n行高属性个数要与行数对应每个数之间用空格间隔";
//
// buttonCZ
//
this.buttonCZ.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@ -179,15 +188,6 @@
this.label3.TabIndex = 4;
this.label3.Text = "Span";
//
// label1
//
this.label1.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(3, 136);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(244, 84);
this.label1.TabIndex = 21;
this.label1.Text = "Span以-为分解。-前为列宽属性,-后为行高属性列宽以;分组。每一组代表一行\r\n行高属性个数要与行数对应,每个数之间用空格间隔";
//
// GridPanelDemo
//
this.Controls.Add(this.stackPanel1);

View File

@ -29,8 +29,8 @@
private void InitializeComponent()
{
this.panel1 = new AntdUI.Panel();
this.pageHeader = new AntdUI.PageHeader();
this.button_close = new AntdUI.Button();
this.pageHeader = new AntdUI.PageHeader();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
@ -46,19 +46,6 @@
this.panel1.TabIndex = 0;
this.panel1.Text = "panel1";
//
// pageHeader
//
this.pageHeader.Dock = System.Windows.Forms.DockStyle.Top;
this.pageHeader.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
this.pageHeader.Location = new System.Drawing.Point(6, 6);
this.pageHeader.MaximizeBox = false;
this.pageHeader.MinimizeBox = false;
this.pageHeader.Name = "pageHeader";
this.pageHeader.ShowIcon = false;
this.pageHeader.Size = new System.Drawing.Size(488, 32);
this.pageHeader.TabIndex = 1;
this.pageHeader.Text = "DrawerDemo";
//
// button_close
//
this.button_close.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
@ -69,9 +56,21 @@
this.button_close.Text = "关闭";
this.button_close.Type = AntdUI.TTypeMini.Error;
//
// pageHeader
//
this.pageHeader.Dock = System.Windows.Forms.DockStyle.Top;
this.pageHeader.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
this.pageHeader.Location = new System.Drawing.Point(6, 6);
this.pageHeader.MaximizeBox = false;
this.pageHeader.MinimizeBox = false;
this.pageHeader.Name = "pageHeader";
this.pageHeader.ShowButton = true;
this.pageHeader.Size = new System.Drawing.Size(488, 32);
this.pageHeader.TabIndex = 1;
this.pageHeader.Text = "DrawerDemo";
//
// Demo
//
this.Controls.Add(this.panel1);
this.Name = "Demo";
this.Size = new System.Drawing.Size(500, 420);

124
Views/SubView/TourTest.Designer.cs generated Normal file
View File

@ -0,0 +1,124 @@
namespace AntdUIDemo.Views.SubView
{
partial class TourTest
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.label1 = new AntdUI.Label();
this.panel1 = new AntdUI.Panel();
this.button_previous = new AntdUI.Button();
this.button_next = new AntdUI.Button();
this.label2 = new AntdUI.Label();
this.label3 = new AntdUI.Label();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// label1
//
this.label1.Dock = System.Windows.Forms.DockStyle.Top;
this.label1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(0, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(220, 36);
this.label1.TabIndex = 0;
//
// panel1
//
this.panel1.Controls.Add(this.label3);
this.panel1.Controls.Add(this.button_previous);
this.panel1.Controls.Add(this.button_next);
this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panel1.Location = new System.Drawing.Point(0, 110);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(220, 40);
this.panel1.TabIndex = 5;
this.panel1.Text = "panel1";
//
// button_previous
//
this.button_previous.BorderWidth = 1F;
this.button_previous.Dock = System.Windows.Forms.DockStyle.Right;
this.button_previous.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button_previous.Location = new System.Drawing.Point(70, 0);
this.button_previous.Name = "button_previous";
this.button_previous.Size = new System.Drawing.Size(75, 40);
this.button_previous.TabIndex = 7;
this.button_previous.Text = "上一步";
//
// button_next
//
this.button_next.BorderWidth = 1F;
this.button_next.Dock = System.Windows.Forms.DockStyle.Right;
this.button_next.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button_next.Location = new System.Drawing.Point(145, 0);
this.button_next.Name = "button_next";
this.button_next.Size = new System.Drawing.Size(75, 40);
this.button_next.TabIndex = 6;
this.button_next.Text = "下一步";
this.button_next.Type = AntdUI.TTypeMini.Primary;
//
// label2
//
this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
this.label2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(0, 36);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(220, 74);
this.label2.TabIndex = 6;
//
// label3
//
this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
this.label3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.Location = new System.Drawing.Point(0, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(70, 40);
this.label3.TabIndex = 8;
//
// TourTest
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
this.Controls.Add(this.label2);
this.Controls.Add(this.panel1);
this.Controls.Add(this.label1);
this.Name = "TourTest";
this.Size = new System.Drawing.Size(220, 150);
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private AntdUI.Label label1;
private AntdUI.Panel panel1;
private AntdUI.Label label3;
private AntdUI.Button button_previous;
private AntdUI.Button button_next;
private AntdUI.Label label2;
}
}

61
Views/SubView/TourTest.cs Normal file
View File

@ -0,0 +1,61 @@
using AntdUI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Net.Mime.MediaTypeNames;
namespace AntdUIDemo.Views.SubView
{
public partial class TourTest : UserControl
{
AntdUI.Tour.Popover popover;
public TourTest(AntdUI.Tour.Popover _popover, string title, string text, int step, int max)
{
popover = _popover;
InitializeComponent();
InitData(title, text, step ,max);
BindEventHandler();
}
private void InitData(string title,string text,int step ,int max)
{
label1.Text = title;
label2.Text = text;
label3.Text = step + " / " + max;
if (step == max)
{
button_next.LocalizationText = "Finish";
button_next.Text = "完成";
}
button_previous.Visible = step > 1;
if (button_previous.Visible)
{
int w1 = (int)(label1.PSize.Width / AntdUI.Config.Dpi), w = (int)((label2.PSize.Width + button_previous.PSize.Width + button_next.PSize.Width) / AntdUI.Config.Dpi);
Width = w1 > w ? w1 : w;
}
}
private void BindEventHandler()
{
button_previous.Click += Button_previous_Click;
button_next.Click += Button_next_Click;
}
private void Button_next_Click(object sender, EventArgs e)
{
popover.Tour.Next();
}
private void Button_previous_Click(object sender, EventArgs e)
{
popover.Tour.Previous();
}
}
}

120
Views/SubView/TourTest.resx Normal file
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>

171
Views/TourDemo.Designer.cs generated Normal file
View File

@ -0,0 +1,171 @@
namespace AntdUIDemo.Views
{
partial class TourDemo
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.header1 = new AntdUI.PageHeader();
this.label3 = new AntdUI.Label();
this.flowPanel1 = new AntdUI.FlowPanel();
this.button_base = new AntdUI.Button();
this.flowPanel2 = new AntdUI.FlowPanel();
this.button3 = new AntdUI.Button();
this.button2 = new AntdUI.Button();
this.button1 = new AntdUI.Button();
this.button_custom = new AntdUI.Button();
this.flowPanel1.SuspendLayout();
this.flowPanel2.SuspendLayout();
this.SuspendLayout();
//
// header1
//
this.header1.Description = "用于分步引导用户了解产品功能的气泡组件。";
this.header1.DividerShow = true;
this.header1.Dock = System.Windows.Forms.DockStyle.Top;
this.header1.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
this.header1.Location = new System.Drawing.Point(0, 0);
this.header1.Name = "header1";
this.header1.Padding = new System.Windows.Forms.Padding(0, 0, 0, 10);
this.header1.Size = new System.Drawing.Size(750, 74);
this.header1.TabIndex = 28;
this.header1.Text = "Tour 漫游式引导";
this.header1.UseTitleFont = true;
//
// label3
//
this.label3.Dock = System.Windows.Forms.DockStyle.Top;
this.label3.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.Location = new System.Drawing.Point(0, 74);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(750, 24);
this.label3.TabIndex = 29;
this.label3.Text = "基本用法";
//
// flowPanel1
//
this.flowPanel1.Controls.Add(this.button_custom);
this.flowPanel1.Controls.Add(this.button_base);
this.flowPanel1.Dock = System.Windows.Forms.DockStyle.Top;
this.flowPanel1.Location = new System.Drawing.Point(0, 98);
this.flowPanel1.Name = "flowPanel1";
this.flowPanel1.Size = new System.Drawing.Size(750, 38);
this.flowPanel1.TabIndex = 30;
this.flowPanel1.Text = "flowPanel1";
//
// button_base
//
this.button_base.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button_base.Location = new System.Drawing.Point(3, 3);
this.button_base.Name = "button_base";
this.button_base.Size = new System.Drawing.Size(100, 32);
this.button_base.TabIndex = 1;
this.button_base.Text = "Begin Tour";
this.button_base.Type = AntdUI.TTypeMini.Primary;
this.button_base.WaveSize = 0;
//
// flowPanel2
//
this.flowPanel2.Controls.Add(this.button3);
this.flowPanel2.Controls.Add(this.button2);
this.flowPanel2.Controls.Add(this.button1);
this.flowPanel2.Dock = System.Windows.Forms.DockStyle.Top;
this.flowPanel2.Location = new System.Drawing.Point(0, 136);
this.flowPanel2.Name = "flowPanel2";
this.flowPanel2.Size = new System.Drawing.Size(750, 38);
this.flowPanel2.TabIndex = 31;
this.flowPanel2.Text = "flowPanel2";
//
// button3
//
this.button3.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button3.IconSvg = "EllipsisOutlined";
this.button3.Location = new System.Drawing.Point(175, 3);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(40, 32);
this.button3.TabIndex = 4;
this.button3.WaveSize = 0;
//
// button2
//
this.button2.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button2.Location = new System.Drawing.Point(89, 3);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(80, 32);
this.button2.TabIndex = 3;
this.button2.Text = "Save";
this.button2.Type = AntdUI.TTypeMini.Primary;
this.button2.WaveSize = 0;
//
// button1
//
this.button1.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button1.Location = new System.Drawing.Point(3, 3);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(80, 32);
this.button1.TabIndex = 2;
this.button1.Text = "Upload";
this.button1.WaveSize = 0;
//
// button_custom
//
this.button_custom.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button_custom.Location = new System.Drawing.Point(109, 3);
this.button_custom.Name = "button_custom";
this.button_custom.Size = new System.Drawing.Size(100, 32);
this.button_custom.TabIndex = 5;
this.button_custom.Text = "Begin Tour";
this.button_custom.Type = AntdUI.TTypeMini.Primary;
this.button_custom.WaveSize = 0;
//
// TourDemo
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
this.Controls.Add(this.flowPanel2);
this.Controls.Add(this.flowPanel1);
this.Controls.Add(this.label3);
this.Controls.Add(this.header1);
this.Name = "TourDemo";
this.Size = new System.Drawing.Size(750, 531);
this.flowPanel1.ResumeLayout(false);
this.flowPanel2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private AntdUI.PageHeader header1;
private AntdUI.Label label3;
private AntdUI.FlowPanel flowPanel1;
private AntdUI.Button button_base;
private AntdUI.FlowPanel flowPanel2;
private AntdUI.Button button3;
private AntdUI.Button button2;
private AntdUI.Button button1;
private AntdUI.Button button_custom;
}
}

117
Views/TourDemo.cs Normal file
View File

@ -0,0 +1,117 @@
using AntdUI;
using AntdUIDemo.Views.SubView;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AntdUIDemo.Views
{
public partial class TourDemo : UserControl
{
private AntdUI.Window window;
private AntdUI.TourForm tourForm;
public TourDemo(AntdUI.Window _window)
{
window = _window;
InitializeComponent();
BindEventHandler();
}
private void BindEventHandler()
{
button_base.Click += Button_base_Click;
button_custom.Click += Button_custom_Click;
}
private void Button_custom_Click(object sender, EventArgs e)
{
if (tourForm == null)
{
Form popover = null;
tourForm = AntdUI.Tour.open(window, item =>
{
//显示位置
switch (item.Index)
{
case 0:
item.Set(button1);
break;
case 1:
item.Set(button2);
break;
case 2:
item.Set(button3);
break;
default:
item.Close();
tourForm = null;
break;
}
}, info =>
{
//提示弹窗
popover?.Close();
popover = null;
//也可以弹自定义控件用法同Popover
TourTest tourTest = new TourTest(info, "提示", "Tour Step " + (info.Index + 1), (info.Index + 1), 3);
if (info.Rect.HasValue) popover = AntdUI.Popover.open(new AntdUI.Popover.Config(info.Form, tourTest)
{
Offset = info.Rect.Value,
Focus = false,
Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(134))),
});
});
}
else
tourForm.Next();
}
private void Button_base_Click(object sender, EventArgs e)
{
if (tourForm == null)
{
Form popover = null;
tourForm = AntdUI.Tour.open(window, item =>
{
//显示位置
switch (item.Index)
{
case 0:
item.Set(button1);
break;
case 1:
item.Set(button2);
break;
case 2:
item.Set(button3);
break;
default:
item.Close();
tourForm = null;
break;
}
}, info =>
{
//提示弹窗
popover?.Close();
popover = null;
//也可以弹自定义控件用法同Popover
if (info.Rect.HasValue) popover = AntdUI.Popover.open(new AntdUI.Popover.Config(info.Form, "提示", "第"+(info.Index+1)+"步")
{
Offset = info.Rect.Value,
Focus = false,
Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(134))),
});
});
}
else
tourForm.Next();
}
}
}

120
Views/TourDemo.resx Normal file
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>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 132 KiB

BIN
assets/screenshots/Tour.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB