| @ -0,0 +1,83 @@ | |||||
| //------------------------------------------------------------------------------ | |||||
| // <auto-generated> | |||||
| // 此代码由工具生成。 | |||||
| // 运行时版本:4.0.30319.42000 | |||||
| // | |||||
| // 对此文件的更改可能会导致不正确的行为,并且如果 | |||||
| // 重新生成代码,这些更改将会丢失。 | |||||
| // </auto-generated> | |||||
| //------------------------------------------------------------------------------ | |||||
| namespace WinFormControl.Properties { | |||||
| using System; | |||||
| /// <summary> | |||||
| /// 一个强类型的资源类,用于查找本地化的字符串等。 | |||||
| /// </summary> | |||||
| // 此类是由 StronglyTypedResourceBuilder | |||||
| // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 | |||||
| // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen | |||||
| // (以 /str 作为命令选项),或重新生成 VS 项目。 | |||||
| [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] | |||||
| [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] | |||||
| [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] | |||||
| internal class Resources { | |||||
| private static global::System.Resources.ResourceManager resourceMan; | |||||
| private static global::System.Globalization.CultureInfo resourceCulture; | |||||
| [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] | |||||
| internal Resources() { | |||||
| } | |||||
| /// <summary> | |||||
| /// 返回此类使用的缓存的 ResourceManager 实例。 | |||||
| /// </summary> | |||||
| [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] | |||||
| internal static global::System.Resources.ResourceManager ResourceManager { | |||||
| get { | |||||
| if (object.ReferenceEquals(resourceMan, null)) { | |||||
| global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WinFormControl.Properties.Resources", typeof(Resources).Assembly); | |||||
| resourceMan = temp; | |||||
| } | |||||
| return resourceMan; | |||||
| } | |||||
| } | |||||
| /// <summary> | |||||
| /// 使用此强类型资源类,为所有资源查找 | |||||
| /// 重写当前线程的 CurrentUICulture 属性。 | |||||
| /// </summary> | |||||
| [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] | |||||
| internal static global::System.Globalization.CultureInfo Culture { | |||||
| get { | |||||
| return resourceCulture; | |||||
| } | |||||
| set { | |||||
| resourceCulture = value; | |||||
| } | |||||
| } | |||||
| /// <summary> | |||||
| /// 查找 System.Drawing.Bitmap 类型的本地化资源。 | |||||
| /// </summary> | |||||
| internal static System.Drawing.Bitmap onclickBtn { | |||||
| get { | |||||
| object obj = ResourceManager.GetObject("onclickBtn", resourceCulture); | |||||
| return ((System.Drawing.Bitmap)(obj)); | |||||
| } | |||||
| } | |||||
| /// <summary> | |||||
| /// 查找 System.Drawing.Bitmap 类型的本地化资源。 | |||||
| /// </summary> | |||||
| internal static System.Drawing.Bitmap simpleBtn { | |||||
| get { | |||||
| object obj = ResourceManager.GetObject("simpleBtn", resourceCulture); | |||||
| return ((System.Drawing.Bitmap)(obj)); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,127 @@ | |||||
| <?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> | |||||
| <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> | |||||
| <data name="onclickBtn" type="System.Resources.ResXFileRef, System.Windows.Forms"> | |||||
| <value>..\Resources\onclickBtn.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> | |||||
| </data> | |||||
| <data name="simpleBtn" type="System.Resources.ResXFileRef, System.Windows.Forms"> | |||||
| <value>..\Resources\simpleBtn.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> | |||||
| </data> | |||||
| </root> | |||||
| @ -0,0 +1,42 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Drawing; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using System.Threading.Tasks; | |||||
| using System.Windows.Forms; | |||||
| using WinFormControl.Properties; | |||||
| namespace WinFormControl | |||||
| { | |||||
| public class UButton : Button | |||||
| { | |||||
| protected override void InitLayout() | |||||
| { | |||||
| base.InitLayout(); | |||||
| this.BackgroundImage = Resources.simpleBtn; | |||||
| this.ForeColor = Color.Black; | |||||
| this.BackColor = Color.Transparent; | |||||
| this.FlatStyle = FlatStyle.Flat; | |||||
| this.FlatAppearance.BorderSize = 0; | |||||
| } | |||||
| protected override void OnClick(EventArgs e) | |||||
| { | |||||
| this.BackgroundImage = Resources.onclickBtn; | |||||
| this.ForeColor = Color.White; | |||||
| this.Refresh(); | |||||
| try | |||||
| { | |||||
| base.OnClick(e); | |||||
| } | |||||
| finally | |||||
| { | |||||
| System.Threading.Thread.Sleep(200); | |||||
| this.BackgroundImage = Resources.simpleBtn; | |||||
| this.ForeColor = Color.Black; | |||||
| this.Refresh(); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,19 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Drawing; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using System.Threading.Tasks; | |||||
| using System.Windows.Forms; | |||||
| namespace WinFormControl | |||||
| { | |||||
| public class ULabel : Label | |||||
| { | |||||
| protected override void InitLayout() | |||||
| { | |||||
| base.InitLayout(); | |||||
| this.BackColor = Color.Transparent; | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,87 @@ | |||||
| namespace WinFormControl | |||||
| { | |||||
| partial class UMessageBox | |||||
| { | |||||
| /// <summary> | |||||
| /// Required designer variable. | |||||
| /// </summary> | |||||
| private System.ComponentModel.IContainer components = null; | |||||
| /// <summary> | |||||
| /// Clean up any resources being used. | |||||
| /// </summary> | |||||
| /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> | |||||
| protected override void Dispose(bool disposing) | |||||
| { | |||||
| if (disposing && (components != null)) | |||||
| { | |||||
| components.Dispose(); | |||||
| } | |||||
| base.Dispose(disposing); | |||||
| } | |||||
| #region Windows Form Designer generated code | |||||
| /// <summary> | |||||
| /// Required method for Designer support - do not modify | |||||
| /// the contents of this method with the code editor. | |||||
| /// </summary> | |||||
| private void InitializeComponent() | |||||
| { | |||||
| System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UMessageBox)); | |||||
| this.uButton1 = new WinFormControl.UButton(); | |||||
| this.label1 = new WinFormControl.ULabel(); | |||||
| this.SuspendLayout(); | |||||
| // | |||||
| // uButton1 | |||||
| // | |||||
| this.uButton1.BackColor = System.Drawing.Color.Transparent; | |||||
| this.uButton1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("uButton1.BackgroundImage"))); | |||||
| this.uButton1.FlatAppearance.BorderSize = 0; | |||||
| this.uButton1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; | |||||
| this.uButton1.Font = new System.Drawing.Font("宋体", 18F); | |||||
| this.uButton1.ForeColor = System.Drawing.Color.Black; | |||||
| this.uButton1.Location = new System.Drawing.Point(114, 127); | |||||
| this.uButton1.Name = "uButton1"; | |||||
| this.uButton1.Size = new System.Drawing.Size(123, 49); | |||||
| this.uButton1.TabIndex = 0; | |||||
| this.uButton1.Text = "确 定"; | |||||
| this.uButton1.UseVisualStyleBackColor = false; | |||||
| this.uButton1.Click += new System.EventHandler(this.uButton1_Click); | |||||
| // | |||||
| // label1 | |||||
| // | |||||
| this.label1.BackColor = System.Drawing.Color.Transparent; | |||||
| this.label1.Font = new System.Drawing.Font("宋体", 15F); | |||||
| this.label1.Location = new System.Drawing.Point(28, 29); | |||||
| this.label1.Name = "label1"; | |||||
| this.label1.Size = new System.Drawing.Size(296, 82); | |||||
| this.label1.TabIndex = 1; | |||||
| this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; | |||||
| // | |||||
| // UMessageBox | |||||
| // | |||||
| this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); | |||||
| this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||||
| this.BackColor = System.Drawing.SystemColors.ControlLightLight; | |||||
| this.ClientSize = new System.Drawing.Size(352, 197); | |||||
| this.Controls.Add(this.label1); | |||||
| this.Controls.Add(this.uButton1); | |||||
| this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; | |||||
| this.MaximizeBox = false; | |||||
| this.MinimizeBox = false; | |||||
| this.Name = "UMessageBox"; | |||||
| this.ShowIcon = false; | |||||
| this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; | |||||
| this.Text = "消息"; | |||||
| this.ResumeLayout(false); | |||||
| } | |||||
| #endregion | |||||
| private UButton uButton1; | |||||
| private ULabel label1; | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,44 @@ | |||||
| 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 WinFormControl | |||||
| { | |||||
| public partial class UMessageBox : Form | |||||
| { | |||||
| public UMessageBox() | |||||
| { | |||||
| InitializeComponent(); | |||||
| } | |||||
| static UMessageBox messageBox; | |||||
| public static void Show(string message) | |||||
| { | |||||
| if (messageBox == null) | |||||
| messageBox = new UMessageBox(); | |||||
| if (message.Length >= 50) | |||||
| message = message.Substring(0, 50) + "……"; | |||||
| messageBox.label1.Text = message; | |||||
| messageBox.ShowDialog(); | |||||
| } | |||||
| public static void Show(string message, string title) | |||||
| { | |||||
| if (messageBox == null) | |||||
| messageBox = new UMessageBox(); | |||||
| messageBox.Text = title; | |||||
| Show(message); | |||||
| } | |||||
| private void uButton1_Click(object sender, EventArgs e) | |||||
| { | |||||
| this.Close(); | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,129 @@ | |||||
| <?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> | |||||
| <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> | |||||
| <data name="uButton1.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | |||||
| <value> | |||||
| iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO | |||||
| wwAADsMBx2+oZAAAAHNJREFUaEPt0AENACAMwDAkowVB14aDz0CTKui5b1gICoKCoCAoCAqCgqAgKAgK | |||||
| goKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAg | |||||
| KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= | |||||
| </value> | |||||
| </data> | |||||
| </root> | |||||
| @ -0,0 +1,48 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Drawing; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using System.Threading.Tasks; | |||||
| using System.Windows.Forms; | |||||
| using WinFormControl.Converter; | |||||
| namespace WinFormControl | |||||
| { | |||||
| public class UTextBoxWithPad : TextBox | |||||
| { | |||||
| public enum TextBoxType | |||||
| { | |||||
| Normal, | |||||
| Number | |||||
| } | |||||
| public UTextBoxWithPad() | |||||
| { | |||||
| this.Font = new Font("宋体", 20); | |||||
| } | |||||
| public TextBoxType Type { get; set; } | |||||
| protected override void OnClick(EventArgs e) | |||||
| { | |||||
| if (this.Type == TextBoxType.Normal) | |||||
| { | |||||
| var keyBoard = new VirtualKeyPad(); | |||||
| if (keyBoard.ShowDialog() == true) | |||||
| this.Text = keyBoard.Result; | |||||
| } | |||||
| else | |||||
| { | |||||
| var keyBoard = new NumberPad(); | |||||
| if (keyBoard.ShowDialog() == true) | |||||
| this.Text = keyBoard.Result; | |||||
| } | |||||
| base.OnClick(e); | |||||
| var form = ControlUtil.GetParentFormm(this); | |||||
| form.Activate(); | |||||
| this.Focus(); | |||||
| } | |||||
| } | |||||
| } | |||||