Table
This commit is contained in:
Generated
+203
@@ -0,0 +1,203 @@
|
||||
namespace AntdUIDemo.Views.Table
|
||||
{
|
||||
partial class UserEdit
|
||||
{
|
||||
/// <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.panel1 = new AntdUI.Panel();
|
||||
this.stackPanel1 = new AntdUI.StackPanel();
|
||||
this.button_ok = new AntdUI.Button();
|
||||
this.button_cancel = new AntdUI.Button();
|
||||
this.divider1 = new AntdUI.Divider();
|
||||
this.input_addr = new AntdUI.Input();
|
||||
this.label2 = new AntdUI.Label();
|
||||
this.input_age = new AntdUI.InputNumber();
|
||||
this.label1 = new AntdUI.Label();
|
||||
this.input_name = new AntdUI.Input();
|
||||
this.label3 = new AntdUI.Label();
|
||||
this.panel1.SuspendLayout();
|
||||
this.stackPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.input_addr);
|
||||
this.panel1.Controls.Add(this.label2);
|
||||
this.panel1.Controls.Add(this.input_age);
|
||||
this.panel1.Controls.Add(this.label1);
|
||||
this.panel1.Controls.Add(this.input_name);
|
||||
this.panel1.Controls.Add(this.label3);
|
||||
this.panel1.Controls.Add(this.divider1);
|
||||
this.panel1.Controls.Add(this.stackPanel1);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Padding = new System.Windows.Forms.Padding(12);
|
||||
this.panel1.Shadow = 6;
|
||||
this.panel1.Size = new System.Drawing.Size(500, 386);
|
||||
this.panel1.TabIndex = 0;
|
||||
this.panel1.Text = "panel1";
|
||||
//
|
||||
// stackPanel1
|
||||
//
|
||||
this.stackPanel1.Controls.Add(this.button_cancel);
|
||||
this.stackPanel1.Controls.Add(this.button_ok);
|
||||
this.stackPanel1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.stackPanel1.Location = new System.Drawing.Point(18, 18);
|
||||
this.stackPanel1.Name = "stackPanel1";
|
||||
this.stackPanel1.RightToLeft = System.Windows.Forms.RightToLeft.No;
|
||||
this.stackPanel1.Size = new System.Drawing.Size(464, 44);
|
||||
this.stackPanel1.TabIndex = 3;
|
||||
this.stackPanel1.Text = "stackPanel1";
|
||||
//
|
||||
// button_ok
|
||||
//
|
||||
this.button_ok.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.button_ok.Location = new System.Drawing.Point(3, 3);
|
||||
this.button_ok.Name = "button_ok";
|
||||
this.button_ok.Size = new System.Drawing.Size(75, 38);
|
||||
this.button_ok.TabIndex = 0;
|
||||
this.button_ok.Text = "Submit";
|
||||
this.button_ok.Type = AntdUI.TTypeMini.Primary;
|
||||
//
|
||||
// button_cancel
|
||||
//
|
||||
this.button_cancel.BorderWidth = 1F;
|
||||
this.button_cancel.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
|
||||
this.button_cancel.Ghost = true;
|
||||
this.button_cancel.Location = new System.Drawing.Point(84, 3);
|
||||
this.button_cancel.Name = "button_cancel";
|
||||
this.button_cancel.Size = new System.Drawing.Size(75, 38);
|
||||
this.button_cancel.TabIndex = 1;
|
||||
this.button_cancel.Text = "Cancel";
|
||||
//
|
||||
// divider1
|
||||
//
|
||||
this.divider1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.divider1.Location = new System.Drawing.Point(18, 62);
|
||||
this.divider1.Name = "divider1";
|
||||
this.divider1.Size = new System.Drawing.Size(464, 12);
|
||||
this.divider1.TabIndex = 14;
|
||||
//
|
||||
// input_addr
|
||||
//
|
||||
this.input_addr.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.input_addr.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.input_addr.Location = new System.Drawing.Point(18, 222);
|
||||
this.input_addr.Name = "input_addr";
|
||||
this.input_addr.Radius = 3;
|
||||
this.input_addr.Size = new System.Drawing.Size(464, 38);
|
||||
this.input_addr.TabIndex = 20;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
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(18, 198);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(464, 24);
|
||||
this.label2.TabIndex = 19;
|
||||
this.label2.Text = "地址";
|
||||
//
|
||||
// input_age
|
||||
//
|
||||
this.input_age.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.input_age.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
|
||||
this.input_age.Location = new System.Drawing.Point(18, 160);
|
||||
this.input_age.Maximum = new decimal(new int[] {
|
||||
200,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.input_age.Minimum = new decimal(new int[] {
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.input_age.Name = "input_age";
|
||||
this.input_age.Radius = 3;
|
||||
this.input_age.Size = new System.Drawing.Size(464, 38);
|
||||
this.input_age.TabIndex = 18;
|
||||
this.input_age.Text = "0";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.label1.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.label1.Location = new System.Drawing.Point(18, 136);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(464, 24);
|
||||
this.label1.TabIndex = 17;
|
||||
this.label1.Text = "年龄";
|
||||
//
|
||||
// input_name
|
||||
//
|
||||
this.input_name.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.input_name.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.input_name.Location = new System.Drawing.Point(18, 98);
|
||||
this.input_name.Name = "input_name";
|
||||
this.input_name.Radius = 3;
|
||||
this.input_name.Size = new System.Drawing.Size(464, 38);
|
||||
this.input_name.TabIndex = 16;
|
||||
//
|
||||
// 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(18, 74);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(464, 24);
|
||||
this.label3.TabIndex = 15;
|
||||
this.label3.Text = "姓名";
|
||||
//
|
||||
// UserEdit
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Name = "UserEdit";
|
||||
this.Size = new System.Drawing.Size(500, 386);
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.stackPanel1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private AntdUI.Panel panel1;
|
||||
private AntdUI.StackPanel stackPanel1;
|
||||
private AntdUI.Button button_cancel;
|
||||
private AntdUI.Button button_ok;
|
||||
private AntdUI.Divider divider1;
|
||||
private AntdUI.Input input_addr;
|
||||
private AntdUI.Label label2;
|
||||
private AntdUI.InputNumber input_age;
|
||||
private AntdUI.Label label1;
|
||||
private AntdUI.Input input_name;
|
||||
private AntdUI.Label label3;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using AntdUIDemo.Models;
|
||||
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.Table
|
||||
{
|
||||
public partial class UserEdit : UserControl
|
||||
{
|
||||
private User user;
|
||||
public UserEdit(User _user)
|
||||
{
|
||||
user = _user;
|
||||
InitializeComponent();
|
||||
//设置默认值
|
||||
InitData();
|
||||
// 绑定事件
|
||||
BindEventHandler();
|
||||
}
|
||||
|
||||
private void BindEventHandler()
|
||||
{
|
||||
button_ok.Click += Button_ok_Click;
|
||||
button_cancel.Click += Button_cancel_Click;
|
||||
}
|
||||
|
||||
private void Button_cancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Dispose();
|
||||
}
|
||||
|
||||
private void Button_ok_Click(object sender, EventArgs e)
|
||||
{
|
||||
input_name.Status = AntdUI.TType.None;
|
||||
//检查输入内容
|
||||
if (String.IsNullOrEmpty(input_name.Text))
|
||||
{
|
||||
input_name.Status = AntdUI.TType.Error;
|
||||
}
|
||||
user.Name = input_name.Text;
|
||||
user.Address = input_addr.Text;
|
||||
user.Age = (int)input_age.Value;
|
||||
this.Dispose();
|
||||
}
|
||||
|
||||
private void InitData()
|
||||
{
|
||||
input_name.Text = user.Name;
|
||||
input_addr.Text = user.Address;
|
||||
input_age.Value = user.Age;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user