添加Tooltip, Tree

This commit is contained in:
czz_y 2024-09-02 14:09:15 +08:00
parent 4384389ad9
commit 6aa75ffede
7 changed files with 945 additions and 0 deletions

View File

@ -244,6 +244,12 @@ namespace AntdUIDemo
case "Timeline": case "Timeline":
control = new TimelineDemo(); control = new TimelineDemo();
break; break;
case "Tooltip":
control = new TooltipDemo();
break;
case "Tree":
control = new TreeDemo();
break;
case "Drawer": case "Drawer":
control = new DrawerDemo(this); control = new DrawerDemo(this);
break; break;

363
Views/TooltipDemo.Designer.cs generated Normal file
View File

@ -0,0 +1,363 @@
namespace AntdUIDemo.Views
{
partial class TooltipDemo
{
/// <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.stackPanel1 = new AntdUI.StackPanel();
this.flowPanel3 = new AntdUI.FlowPanel();
this.buttonRB = new AntdUI.Button();
this.buttonRight = new AntdUI.Button();
this.buttonRT = new AntdUI.Button();
this.buttonTL = new AntdUI.Button();
this.buttonTop = new AntdUI.Button();
this.buttonTR = new AntdUI.Button();
this.flowPanel2 = new AntdUI.FlowPanel();
this.buttonLB = new AntdUI.Button();
this.buttonLeft = new AntdUI.Button();
this.buttonLT = new AntdUI.Button();
this.buttonBL = new AntdUI.Button();
this.buttonBottom = new AntdUI.Button();
this.buttonBR = new AntdUI.Button();
this.label4 = new AntdUI.Label();
this.flowPanel1 = new AntdUI.FlowPanel();
this.label_show = new AntdUI.Label();
this.label3 = new AntdUI.Label();
this.divider1 = new AntdUI.Divider();
this.label2 = new AntdUI.Label();
this.label1 = new AntdUI.Label();
this.label_showclick = new AntdUI.Label();
this.tooltip1 = new AntdUI.Tooltip();
this.stackPanel1.SuspendLayout();
this.flowPanel3.SuspendLayout();
this.flowPanel2.SuspendLayout();
this.flowPanel1.SuspendLayout();
this.SuspendLayout();
//
// stackPanel1
//
this.stackPanel1.Controls.Add(this.flowPanel3);
this.stackPanel1.Controls.Add(this.flowPanel2);
this.stackPanel1.Controls.Add(this.label4);
this.stackPanel1.Controls.Add(this.flowPanel1);
this.stackPanel1.Controls.Add(this.label3);
this.stackPanel1.Controls.Add(this.divider1);
this.stackPanel1.Controls.Add(this.label2);
this.stackPanel1.Controls.Add(this.label1);
this.stackPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.stackPanel1.Location = new System.Drawing.Point(0, 0);
this.stackPanel1.Name = "stackPanel1";
this.stackPanel1.Size = new System.Drawing.Size(700, 506);
this.stackPanel1.TabIndex = 0;
this.stackPanel1.Text = "stackPanel1";
this.stackPanel1.Vertical = true;
//
// flowPanel3
//
this.flowPanel3.Controls.Add(this.buttonRB);
this.flowPanel3.Controls.Add(this.buttonRight);
this.flowPanel3.Controls.Add(this.buttonRT);
this.flowPanel3.Controls.Add(this.buttonTL);
this.flowPanel3.Controls.Add(this.buttonTop);
this.flowPanel3.Controls.Add(this.buttonTR);
this.flowPanel3.Location = new System.Drawing.Point(3, 257);
this.flowPanel3.Name = "flowPanel3";
this.flowPanel3.Size = new System.Drawing.Size(694, 38);
this.flowPanel3.TabIndex = 39;
this.flowPanel3.Text = "flowPanel3";
//
// buttonRB
//
this.buttonRB.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
this.buttonRB.Location = new System.Drawing.Point(483, 3);
this.buttonRB.Name = "buttonRB";
this.buttonRB.Size = new System.Drawing.Size(90, 32);
this.buttonRB.TabIndex = 5;
this.buttonRB.Text = "RB";
this.buttonRB.Type = AntdUI.TTypeMini.Primary;
this.buttonRB.WaveSize = 0;
//
// buttonRight
//
this.buttonRight.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
this.buttonRight.Location = new System.Drawing.Point(387, 3);
this.buttonRight.Name = "buttonRight";
this.buttonRight.Size = new System.Drawing.Size(90, 32);
this.buttonRight.TabIndex = 4;
this.buttonRight.Text = "Right";
this.buttonRight.Type = AntdUI.TTypeMini.Primary;
this.buttonRight.WaveSize = 0;
//
// buttonRT
//
this.buttonRT.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
this.buttonRT.Location = new System.Drawing.Point(291, 3);
this.buttonRT.Name = "buttonRT";
this.buttonRT.Size = new System.Drawing.Size(90, 32);
this.buttonRT.TabIndex = 3;
this.buttonRT.Text = "RT";
this.buttonRT.Type = AntdUI.TTypeMini.Primary;
this.buttonRT.WaveSize = 0;
//
// buttonTL
//
this.buttonTL.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
this.buttonTL.Location = new System.Drawing.Point(195, 3);
this.buttonTL.Name = "buttonTL";
this.buttonTL.Size = new System.Drawing.Size(90, 32);
this.buttonTL.TabIndex = 2;
this.buttonTL.Text = "TL";
this.buttonTL.Type = AntdUI.TTypeMini.Primary;
this.buttonTL.WaveSize = 0;
//
// buttonTop
//
this.buttonTop.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
this.buttonTop.Location = new System.Drawing.Point(99, 3);
this.buttonTop.Name = "buttonTop";
this.buttonTop.Size = new System.Drawing.Size(90, 32);
this.buttonTop.TabIndex = 1;
this.buttonTop.Text = "Top";
this.buttonTop.Type = AntdUI.TTypeMini.Primary;
this.buttonTop.WaveSize = 0;
//
// buttonTR
//
this.buttonTR.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
this.buttonTR.Location = new System.Drawing.Point(3, 3);
this.buttonTR.Name = "buttonTR";
this.buttonTR.Size = new System.Drawing.Size(90, 32);
this.buttonTR.TabIndex = 0;
this.buttonTR.Text = "TR";
this.buttonTR.Type = AntdUI.TTypeMini.Primary;
this.buttonTR.WaveSize = 0;
//
// flowPanel2
//
this.flowPanel2.Controls.Add(this.buttonLB);
this.flowPanel2.Controls.Add(this.buttonLeft);
this.flowPanel2.Controls.Add(this.buttonLT);
this.flowPanel2.Controls.Add(this.buttonBL);
this.flowPanel2.Controls.Add(this.buttonBottom);
this.flowPanel2.Controls.Add(this.buttonBR);
this.flowPanel2.Location = new System.Drawing.Point(3, 213);
this.flowPanel2.Name = "flowPanel2";
this.flowPanel2.Size = new System.Drawing.Size(694, 38);
this.flowPanel2.TabIndex = 38;
this.flowPanel2.Text = "flowPanel2";
//
// buttonLB
//
this.buttonLB.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
this.buttonLB.Location = new System.Drawing.Point(483, 3);
this.buttonLB.Name = "buttonLB";
this.buttonLB.Size = new System.Drawing.Size(90, 32);
this.buttonLB.TabIndex = 5;
this.buttonLB.Text = "LB";
this.buttonLB.Type = AntdUI.TTypeMini.Primary;
this.buttonLB.WaveSize = 0;
//
// buttonLeft
//
this.buttonLeft.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
this.buttonLeft.Location = new System.Drawing.Point(387, 3);
this.buttonLeft.Name = "buttonLeft";
this.buttonLeft.Size = new System.Drawing.Size(90, 32);
this.buttonLeft.TabIndex = 4;
this.buttonLeft.Text = "Left";
this.buttonLeft.Type = AntdUI.TTypeMini.Primary;
this.buttonLeft.WaveSize = 0;
//
// buttonLT
//
this.buttonLT.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
this.buttonLT.Location = new System.Drawing.Point(291, 3);
this.buttonLT.Name = "buttonLT";
this.buttonLT.Size = new System.Drawing.Size(90, 32);
this.buttonLT.TabIndex = 3;
this.buttonLT.Text = "LT";
this.buttonLT.Type = AntdUI.TTypeMini.Primary;
this.buttonLT.WaveSize = 0;
//
// buttonBL
//
this.buttonBL.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
this.buttonBL.Location = new System.Drawing.Point(195, 3);
this.buttonBL.Name = "buttonBL";
this.buttonBL.Size = new System.Drawing.Size(90, 32);
this.buttonBL.TabIndex = 2;
this.buttonBL.Text = "BL";
this.buttonBL.Type = AntdUI.TTypeMini.Primary;
this.buttonBL.WaveSize = 0;
//
// buttonBottom
//
this.buttonBottom.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
this.buttonBottom.Location = new System.Drawing.Point(99, 3);
this.buttonBottom.Name = "buttonBottom";
this.buttonBottom.Size = new System.Drawing.Size(90, 32);
this.buttonBottom.TabIndex = 1;
this.buttonBottom.Text = "Bottom";
this.buttonBottom.Type = AntdUI.TTypeMini.Primary;
this.buttonBottom.WaveSize = 0;
//
// buttonBR
//
this.buttonBR.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
this.buttonBR.Location = new System.Drawing.Point(3, 3);
this.buttonBR.Name = "buttonBR";
this.buttonBR.Size = new System.Drawing.Size(90, 32);
this.buttonBR.TabIndex = 0;
this.buttonBR.Text = "BR";
this.buttonBR.Type = AntdUI.TTypeMini.Primary;
this.buttonBR.WaveSize = 0;
//
// label4
//
this.label4.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label4.Location = new System.Drawing.Point(3, 183);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(694, 24);
this.label4.TabIndex = 14;
this.label4.Text = "弹出位置";
//
// flowPanel1
//
this.flowPanel1.Controls.Add(this.tooltip1);
this.flowPanel1.Controls.Add(this.label_showclick);
this.flowPanel1.Controls.Add(this.label_show);
this.flowPanel1.Location = new System.Drawing.Point(3, 127);
this.flowPanel1.Name = "flowPanel1";
this.flowPanel1.Size = new System.Drawing.Size(694, 50);
this.flowPanel1.TabIndex = 13;
this.flowPanel1.Text = "flowPanel1";
//
// label_show
//
this.label_show.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label_show.Location = new System.Drawing.Point(3, 3);
this.label_show.Name = "label_show";
this.label_show.Size = new System.Drawing.Size(220, 32);
this.label_show.TabIndex = 0;
this.label_show.Text = "Tooltip will show on mouse enter.";
//
// label3
//
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(3, 97);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(694, 24);
this.label3.TabIndex = 12;
this.label3.Text = "基本用法";
//
// divider1
//
this.divider1.Location = new System.Drawing.Point(3, 79);
this.divider1.Name = "divider1";
this.divider1.Size = new System.Drawing.Size(694, 12);
this.divider1.TabIndex = 11;
//
// 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(3, 49);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(694, 24);
this.label2.TabIndex = 10;
this.label2.Text = "简单的文字提示气泡框。";
//
// label1
//
this.label1.Font = new System.Drawing.Font("Microsoft YaHei UI", 26.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(3, 3);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(694, 40);
this.label1.TabIndex = 9;
this.label1.Text = "Tooltip 文字提示";
//
// label_showclick
//
this.label_showclick.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label_showclick.Location = new System.Drawing.Point(229, 3);
this.label_showclick.Name = "label_showclick";
this.label_showclick.Size = new System.Drawing.Size(220, 32);
this.label_showclick.TabIndex = 1;
this.label_showclick.Text = "Tooltip will show on mouse click.";
//
// tooltip1
//
this.tooltip1.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
this.tooltip1.Location = new System.Drawing.Point(455, 3);
this.tooltip1.MaximumSize = new System.Drawing.Size(106, 45);
this.tooltip1.MinimumSize = new System.Drawing.Size(106, 45);
this.tooltip1.Name = "tooltip1";
this.tooltip1.Size = new System.Drawing.Size(106, 45);
this.tooltip1.TabIndex = 2;
this.tooltip1.Text = "Single Tooltip";
//
// TooltipDemo
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
this.Controls.Add(this.stackPanel1);
this.Name = "TooltipDemo";
this.Size = new System.Drawing.Size(700, 506);
this.stackPanel1.ResumeLayout(false);
this.flowPanel3.ResumeLayout(false);
this.flowPanel2.ResumeLayout(false);
this.flowPanel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private AntdUI.StackPanel stackPanel1;
private AntdUI.Label label3;
private AntdUI.Divider divider1;
private AntdUI.Label label2;
private AntdUI.Label label1;
private AntdUI.FlowPanel flowPanel1;
private AntdUI.Label label_show;
private AntdUI.Label label4;
private AntdUI.FlowPanel flowPanel3;
private AntdUI.Button buttonRB;
private AntdUI.Button buttonRight;
private AntdUI.Button buttonRT;
private AntdUI.Button buttonTL;
private AntdUI.Button buttonTop;
private AntdUI.Button buttonTR;
private AntdUI.FlowPanel flowPanel2;
private AntdUI.Button buttonLB;
private AntdUI.Button buttonLeft;
private AntdUI.Button buttonLT;
private AntdUI.Button buttonBL;
private AntdUI.Button buttonBottom;
private AntdUI.Button buttonBR;
private AntdUI.Label label_showclick;
private AntdUI.Tooltip tooltip1;
}
}

112
Views/TooltipDemo.cs Normal file
View File

@ -0,0 +1,112 @@
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 TooltipDemo : UserControl
{
public TooltipDemo()
{
InitializeComponent();
BindingEventHandler();
}
private void BindingEventHandler()
{
AntdUI.TooltipComponent tooltip = new AntdUI.TooltipComponent()
{
Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(134))),
};
tooltip.SetTip(label_show, "prompt text");
label_showclick.Click += (sender, e) =>
{
AntdUI.Tooltip.open(new AntdUI.Tooltip.Config(label_showclick, "prompt text")
{
Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(134))),
});
};
BindButtonWithToolTip(this);
}
private void BindButtonWithToolTip(Control parent)
{
foreach (Control control in parent.Controls)
{
if (control is AntdUI.Button button)
{
AntdUI.TooltipComponent tooltip = new AntdUI.TooltipComponent()
{
Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(134))),
};
var text = button.Text;
switch (text)
{
case "BR":
tooltip.ArrowAlign = AntdUI.TAlign.BR;
tooltip.SetTip(control, "prompt text");
break;
case "BL":
tooltip.ArrowAlign = AntdUI.TAlign.BL;
tooltip.SetTip(control, "prompt text");
break;
case "Bottom":
tooltip.ArrowAlign = AntdUI.TAlign.Bottom;
tooltip.SetTip(control, "prompt text");
break;
case "TR":
tooltip.ArrowAlign = AntdUI.TAlign.TR;
tooltip.SetTip(control, "prompt text");
break;
case "TL":
tooltip.ArrowAlign = AntdUI.TAlign.TL;
tooltip.SetTip(control, "prompt text");
break;
case "Top":
tooltip.ArrowAlign = AntdUI.TAlign.Top;
tooltip.SetTip(control, "prompt text");
break;
case "LT":
tooltip.ArrowAlign = AntdUI.TAlign.LT;
tooltip.SetTip(control, "prompt text");
break;
case "LB":
tooltip.ArrowAlign = AntdUI.TAlign.LB;
tooltip.SetTip(control, "prompt text");
break;
case "RT":
tooltip.ArrowAlign = AntdUI.TAlign.RT;
tooltip.SetTip(control, "prompt text");
break;
case "RB":
tooltip.ArrowAlign = AntdUI.TAlign.RB;
tooltip.SetTip(control, "prompt text");
break;
case "Left":
tooltip.ArrowAlign = AntdUI.TAlign.Left;
tooltip.SetTip(control, "prompt text");
break;
case "Right":
tooltip.ArrowAlign = AntdUI.TAlign.Right;
tooltip.SetTip(control, "prompt text");
break;
default:
break;
}
}
// 递归遍历子控件
if (control.HasChildren)
{
BindButtonWithToolTip(control);
}
}
}
}
}

120
Views/TooltipDemo.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>

204
Views/TreeDemo.Designer.cs generated Normal file
View File

@ -0,0 +1,204 @@
namespace AntdUIDemo.Views
{
partial class TreeDemo
{
/// <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()
{
AntdUI.TreeItem treeItem7 = new AntdUI.TreeItem();
AntdUI.TreeItem treeItem8 = new AntdUI.TreeItem();
AntdUI.TreeItem treeItem9 = new AntdUI.TreeItem();
AntdUI.TreeItem treeItem10 = new AntdUI.TreeItem();
AntdUI.TreeItem treeItem11 = new AntdUI.TreeItem();
AntdUI.TreeItem treeItem12 = new AntdUI.TreeItem();
AntdUI.TreeItem treeItem1 = new AntdUI.TreeItem();
AntdUI.TreeItem treeItem2 = new AntdUI.TreeItem();
AntdUI.TreeItem treeItem3 = new AntdUI.TreeItem();
AntdUI.TreeItem treeItem4 = new AntdUI.TreeItem();
AntdUI.TreeItem treeItem5 = new AntdUI.TreeItem();
AntdUI.TreeItem treeItem6 = new AntdUI.TreeItem();
this.stackPanel1 = new AntdUI.StackPanel();
this.divider1 = new AntdUI.Divider();
this.label2 = new AntdUI.Label();
this.label1 = new AntdUI.Label();
this.stackPanel2 = new AntdUI.StackPanel();
this.tree1 = new AntdUI.Tree();
this.tree2 = new AntdUI.Tree();
this.stackPanel1.SuspendLayout();
this.stackPanel2.SuspendLayout();
this.SuspendLayout();
//
// stackPanel1
//
this.stackPanel1.Controls.Add(this.stackPanel2);
this.stackPanel1.Controls.Add(this.divider1);
this.stackPanel1.Controls.Add(this.label2);
this.stackPanel1.Controls.Add(this.label1);
this.stackPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.stackPanel1.Location = new System.Drawing.Point(0, 0);
this.stackPanel1.Name = "stackPanel1";
this.stackPanel1.Size = new System.Drawing.Size(700, 477);
this.stackPanel1.TabIndex = 0;
this.stackPanel1.Text = "stackPanel1";
this.stackPanel1.Vertical = true;
//
// divider1
//
this.divider1.Location = new System.Drawing.Point(3, 79);
this.divider1.Name = "divider1";
this.divider1.Size = new System.Drawing.Size(694, 12);
this.divider1.TabIndex = 14;
//
// 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(3, 49);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(694, 24);
this.label2.TabIndex = 13;
this.label2.Text = "多层次的结构列表。";
//
// label1
//
this.label1.Font = new System.Drawing.Font("Microsoft YaHei UI", 26.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(3, 3);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(694, 40);
this.label1.TabIndex = 12;
this.label1.Text = "Tree 树形控件";
//
// stackPanel2
//
this.stackPanel2.Controls.Add(this.tree2);
this.stackPanel2.Controls.Add(this.tree1);
this.stackPanel2.Location = new System.Drawing.Point(3, 97);
this.stackPanel2.Name = "stackPanel2";
this.stackPanel2.Size = new System.Drawing.Size(694, 377);
this.stackPanel2.TabIndex = 15;
this.stackPanel2.Text = "stackPanel2";
//
// tree1
//
this.tree1.Checkable = true;
this.tree1.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
treeItem7.Expand = true;
treeItem7.PARENTITEM = null;
treeItem8.Checked = true;
treeItem8.CheckState = System.Windows.Forms.CheckState.Checked;
treeItem8.Enabled = false;
treeItem8.Expand = true;
treeItem8.PARENTITEM = treeItem7;
treeItem9.Expand = true;
treeItem9.PARENTITEM = treeItem8;
treeItem9.Text = "leaf";
treeItem10.PARENTITEM = treeItem8;
treeItem10.Text = "leaf";
treeItem8.Sub.Add(treeItem9);
treeItem8.Sub.Add(treeItem10);
treeItem8.Text = "parent1-0";
treeItem11.Checked = true;
treeItem11.CheckState = System.Windows.Forms.CheckState.Checked;
treeItem11.Expand = true;
treeItem11.PARENTITEM = treeItem7;
treeItem12.Checked = true;
treeItem12.CheckState = System.Windows.Forms.CheckState.Checked;
treeItem12.Expand = true;
treeItem12.PARENTITEM = treeItem11;
treeItem12.Text = "sss";
treeItem11.Sub.Add(treeItem12);
treeItem11.Text = "parent1-1";
treeItem7.Sub.Add(treeItem8);
treeItem7.Sub.Add(treeItem11);
treeItem7.Text = "parent1";
this.tree1.Items.Add(treeItem7);
this.tree1.Location = new System.Drawing.Point(3, 3);
this.tree1.Name = "tree1";
this.tree1.Size = new System.Drawing.Size(247, 371);
this.tree1.TabIndex = 0;
this.tree1.Text = "tree1";
//
// tree2
//
this.tree2.BlockNode = true;
this.tree2.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
treeItem1.CheckState = System.Windows.Forms.CheckState.Indeterminate;
treeItem1.Expand = true;
treeItem1.PARENTITEM = null;
treeItem2.Enabled = false;
treeItem2.Expand = true;
treeItem2.PARENTITEM = treeItem1;
treeItem3.Expand = true;
treeItem3.PARENTITEM = treeItem2;
treeItem3.Text = "leaf";
treeItem4.PARENTITEM = treeItem2;
treeItem4.Text = "leaf";
treeItem2.Sub.Add(treeItem3);
treeItem2.Sub.Add(treeItem4);
treeItem2.Text = "parent1-0";
treeItem5.Checked = true;
treeItem5.CheckState = System.Windows.Forms.CheckState.Checked;
treeItem5.Expand = true;
treeItem5.PARENTITEM = treeItem1;
treeItem6.Checked = true;
treeItem6.CheckState = System.Windows.Forms.CheckState.Checked;
treeItem6.Expand = true;
treeItem6.PARENTITEM = treeItem5;
treeItem6.Text = "sss";
treeItem5.Sub.Add(treeItem6);
treeItem5.Text = "parent1-1";
treeItem1.Sub.Add(treeItem2);
treeItem1.Sub.Add(treeItem5);
treeItem1.Text = "parent1";
this.tree2.Items.Add(treeItem1);
this.tree2.Location = new System.Drawing.Point(256, 3);
this.tree2.Name = "tree2";
this.tree2.Size = new System.Drawing.Size(247, 371);
this.tree2.TabIndex = 1;
this.tree2.Text = "tree2";
//
// TreeDemo
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
this.Controls.Add(this.stackPanel1);
this.Name = "TreeDemo";
this.Size = new System.Drawing.Size(700, 477);
this.stackPanel1.ResumeLayout(false);
this.stackPanel2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private AntdUI.StackPanel stackPanel1;
private AntdUI.Divider divider1;
private AntdUI.Label label2;
private AntdUI.Label label1;
private AntdUI.StackPanel stackPanel2;
private AntdUI.Tree tree1;
private AntdUI.Tree tree2;
}
}

20
Views/TreeDemo.cs Normal file
View File

@ -0,0 +1,20 @@
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 TreeDemo : UserControl
{
public TreeDemo()
{
InitializeComponent();
}
}
}

120
Views/TreeDemo.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>