1、优化LOG显示与引用

2、添加PMA工具,工具内容待完善
3、修复流程树显示
4、添加开源项目,优化UI空间
5、其他BUG更改
This commit is contained in:
liu.wenjie
2021-11-23 15:51:37 +08:00
parent 47f77f5e64
commit a24dda2525
474 changed files with 91916 additions and 6429 deletions

View File

@@ -0,0 +1,73 @@
namespace Controls
{
partial class CButton
{
/// <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.btn_button = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// btn_button
//
this.btn_button.BackgroundImage = global::Controls.Properties.Resources.ButtonUp;
this.btn_button.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.btn_button.Dock = System.Windows.Forms.DockStyle.Fill;
this.btn_button.FlatAppearance.BorderSize = 0;
this.btn_button.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_button.ForeColor = System.Drawing.Color.White;
this.btn_button.Location = new System.Drawing.Point(0, 0);
this.btn_button.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.btn_button.Name = "btn_button";
this.btn_button.Size = new System.Drawing.Size(67, 28);
this.btn_button.TabIndex = 0;
this.btn_button.Text = "Button";
this.btn_button.UseVisualStyleBackColor = true;
this.btn_button.Click += new System.EventHandler(this.btn_button_Click);
this.btn_button.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btn_button_MouseDown);
this.btn_button.MouseEnter += new System.EventHandler(this.btn_button_MouseEnter);
this.btn_button.MouseLeave += new System.EventHandler(this.btn_button_MouseLeave);
this.btn_button.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btn_button_MouseUp);
//
// CButton
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.Controls.Add(this.btn_button);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.Name = "CButton";
this.Size = new System.Drawing.Size(67, 28);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button btn_button;
}
}

View File

@@ -0,0 +1,67 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Controls.Properties;
namespace Controls
{
public delegate void DClicked();
public partial class CButton : UserControl
{
public CButton()
{
InitializeComponent();
btn_button.Text = TextStr;
}
/// <summary>
/// 点击事件
/// </summary>
public event DClicked Clicked;
/// <summary>
/// 文本
/// </summary>
private string _textStr = "Button";
public string TextStr
{
get { return _textStr; }
set
{
_textStr = value;
btn_button.Text = value;
}
}
private void btn_button_MouseEnter(object sender, EventArgs e)
{
btn_button.BackgroundImage = Resources.ButtonEnter;
Application.DoEvents();
}
private void btn_button_MouseDown(object sender, MouseEventArgs e)
{
btn_button.BackgroundImage = Resources.ButtonDown;
Application.DoEvents();
}
private void btn_button_MouseLeave(object sender, EventArgs e)
{
btn_button.BackgroundImage = Resources.ButtonUp;
Application.DoEvents();
}
private void btn_button_MouseUp(object sender, MouseEventArgs e)
{
btn_button.BackgroundImage = Resources.ButtonUp;
Application.DoEvents();
}
private void btn_button_Click(object sender, EventArgs e)
{
if (Clicked != null)
Clicked();
}
}
}

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>

View File

@@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Controls.Properties;
namespace Controls
{
public delegate void DCheckChanged(bool Checked);
public partial class CCheckBox : UserControl
{
public CCheckBox()
{
InitializeComponent();
ckb_box.Text = TextStr;
}
/// <summary>
/// 状态改变事件
/// </summary>
public event DCheckChanged CheckChanged;
/// <summary>
/// 勾选状态
/// </summary>
private bool _checked = false;
public bool Checked
{
get { return _checked; }
set
{
_checked = value;
ckb_box.Checked = value;
}
}
/// <summary>
/// 文本
/// </summary>
private string _textStr = "复选框";
public string TextStr
{
get { return _textStr; }
set
{
_textStr = value;
ckb_box.Text = value;
}
}
private void pic_image_Click(object sender, EventArgs e)
{
ckb_box.Checked = !ckb_box.Checked;
}
private void ckb_box_CheckedChanged(object sender, EventArgs e)
{
if (ckb_box.Checked)
{
pic_image.Image = Resources.;
Checked = true;
}
else
{
pic_image.Image = Resources.;
Checked = false;
}
if (CheckChanged != null)
CheckChanged(ckb_box.Checked);
}
}
}

View File

@@ -0,0 +1,85 @@
namespace Controls
{
partial class CCheckBox
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CCheckBox));
this.pic_image = new System.Windows.Forms.PictureBox();
this.ckb_box = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.pic_image)).BeginInit();
this.SuspendLayout();
//
// pic_image
//
this.pic_image.Image = ((System.Drawing.Image)(resources.GetObject("pic_image.Image")));
this.pic_image.Location = new System.Drawing.Point(1, 1);
this.pic_image.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.pic_image.Name = "pic_image";
this.pic_image.Size = new System.Drawing.Size(18, 18);
this.pic_image.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pic_image.TabIndex = 0;
this.pic_image.TabStop = false;
this.pic_image.Click += new System.EventHandler(this.pic_image_Click);
//
// ckb_box
//
this.ckb_box.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.ckb_box.BackColor = System.Drawing.Color.White;
this.ckb_box.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.ckb_box.Location = new System.Drawing.Point(5, 1);
this.ckb_box.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.ckb_box.Name = "ckb_box";
this.ckb_box.Size = new System.Drawing.Size(161, 23);
this.ckb_box.TabIndex = 1;
this.ckb_box.Text = "复选框";
this.ckb_box.UseVisualStyleBackColor = false;
this.ckb_box.CheckedChanged += new System.EventHandler(this.ckb_box_CheckedChanged);
//
// CCheckBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.Controls.Add(this.pic_image);
this.Controls.Add(this.ckb_box);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.Name = "CCheckBox";
this.Size = new System.Drawing.Size(167, 20);
((System.ComponentModel.ISupportInitialize)(this.pic_image)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.PictureBox pic_image;
private System.Windows.Forms.CheckBox ckb_box;
}
}

View File

@@ -0,0 +1,145 @@
<?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="pic_image.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABGdBTUEAALGPC/xhBQAABGFJREFUeF7t
nYFR20AQRSnBJVBCOgglpIPQQdxBKIEOoBKTDkgHSQdJB8n/mTXjEYJIp7vT7u3/M29gQNrz+D9sy9jy
laIoiqIoiqIoiqIU5unp6fp0On0U7eB1bFf3/uGFAV/AM/gjusLrnNd9fyGw6AE8gLkLJvrDLg5WT9tg
oRvwyxYWfmAnH6ymNsECtxcLCp/cWl11g8H8y59bUPij7i0BBvI+Xzf7cWBX9R4TYNjjxXARg0erb1sw
iId6cwsI/2w/RMSQ42SoiMPRaiwPhuhJnrg8W43lmRkqAmE1lgUDdP8fn/LHAdhZx/7xubE614c7T4aJ
eEiA5EiA5EiA5EiA5EiA5EiA5EiA5EiA5EiA5EiA5EiA5EiA5EiA5EiA5EgAb5xOp5/4ylda3+H7b5e/
a4AE8ALK/o2vr965g5/xXdWtRJAAHrDy333HDrb5Pt2vAhJgb5aUz3Cby/0qIQH2ZGn552B7Pj6YnVWI
BNiLteUz2Kf2YwEJsAcl5TMSYABKy2emsyogAXqysfy7y1mVkAC92Fh+iyMAIgF6UKH8VifgkACtcVw+
kQAtcV4+kQCtCFA+kQAtCFI+kQCNKLpisV/P8okEaEDRyRixX+/yiQSoTKTyiQSoSLTyiQSoRMTyiQSo
QNTyiV8BcCh1fnHkPb5v/eLIUiKXT/wJYMfQr65Y/IwvjmzxurhSopdPXN4CvHuhnNwajFA+cSfAnY1/
M9jmsPMtwSjlE3cCLLpA2G4vCUYqn/gSwEYvCrbvLcFo5RN3twCrzl2L7XtJMGL5xJ0An2z84mCf1hKM
Wj5xJ8APG78q2K+VBCOXT9wJQB5siVXBfrUlKC2fH6IV5YM0XApA9pYgQ/nErQBkiwRb3kOXpXziWgBS
fB8MCfiU8tzM98hUPnEvAOklQbbySQgBSGsJMpZPwghAWkmQtXwSSgBSW4LM5ZNwApBaEmQvn4QUgGyV
oOjDk7HfSOWTsAKQUgmKPiwR+41WPgktACmSYG2wzojlk/ACkKL34C0N5o9aPhlCAP7XrYkEmDty+WQI
AUh1CTBv9PLJMAKQahJgTobyyVACkM0SYP8s5ZPhBCDFEmC/TOWTIQUgqyXA9tnKJ8MKQBZLgO0ylk+G
FoD8VwL8Pmv5ZHgByJsS4OeZyycpBDjzFfwTAV+vwWdAOea2zUIqAcRrJEByJEByJEByJEByJEByJEBy
JEByJEByJEByJEByJEByJEByJEByJEByJEByJEByJEByJEByNgnA19XNDRVxKDpXwktmBopAWI3lOfU5
VbtoALuzGsuDQcfpYBGGo9VYHgzR44C4bLv/PweD+Nl+cwsIv9xbfduDYTw795LTsQoHWFcHq69OMJCf
kDG7oHDHqrfNLw4G304WEv5oe1o9LLD07NyiI9ZJm7/8abAQ33KtB4Z+uAd17/OXBIvyEPHIJxzsgohO
2HXO52jqHOrVCC8M4D+QRDv8FK4oiqIoiqIoiqLEytXVXycxKra7YoNwAAAAAElFTkSuQmCC
</value>
</data>
</root>

View File

@@ -0,0 +1,134 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Controls.Properties;
namespace Controls
{
public delegate void DSelectedIndexChanged();
public partial class CComboBox : UserControl
{
public CComboBox()
{
InitializeComponent();
cbx_item.Items.AddRange(Items);
}
/// <summary>
/// 选中项改变事件
/// </summary>
public event DSelectedIndexChanged SelectedIndexChanged;
/// <summary>
/// 选中项索引
/// </summary>
private int _selectedIndex = -1;
public int SelectedIndex
{
get { return _selectedIndex; }
set
{
_selectedIndex = value;
cbx_item.SelectedIndex = value;
}
}
/// <summary>
/// 文本
/// </summary>
private string _text = string.Empty;
public string TextStr
{
get { return _text; }
set
{
_text = value;
cbx_item.Text = value;
}
}
/// <summary>
/// 是否可以编辑
/// </summary>
private bool _canEdit = false;
public bool CanEdit
{
get { return _canEdit; }
set
{
_canEdit = value;
if (value)
cbx_item.DropDownStyle = ComboBoxStyle.DropDown;
else
cbx_item.DropDownStyle = ComboBoxStyle.DropDownList;
}
}
/// <summary>
/// 项
/// </summary>
private string[] _items = new string[] { };
public string[] Items
{
get { return _items; }
set
{
_items = value;
cbx_item.Items.Clear();
cbx_item.Items.AddRange(value);
}
}
/// <summary>
/// 删除所有项
/// </summary>
public void Clear()
{
Items = new string[] { };
cbx_item.Items.Clear();
}
/// <summary>
/// 添加项
/// </summary>
/// <param name="item">项</param>
public void Add(string item)
{
string[] items = new string[Items.Length + 1];
for (int i = 0; i < Items.Length; i++)
{
items[i] = Items[i];
}
items[Items.Length] = item;
Items = items;
}
private void cbx_item_SelectedIndexChanged(object sender, EventArgs e)
{
SelectedIndex = cbx_item.SelectedIndex;
TextStr = cbx_item.Text;
if (SelectedIndexChanged != null)
SelectedIndexChanged();
}
private void ComboBox_Enter(object sender, EventArgs e)
{
lbl_line.Height = 2;
lbl_line.BackColor = Color.FromArgb(18, 150, 219);
btn_showItem.Image = Resources.BlueImage;
}
private void ComboBox_Leave(object sender, EventArgs e)
{
lbl_line.Height = 1;
lbl_line.BackColor = Color.Gray;
btn_showItem.Image = Resources.GrayImage;
}
private void btn_showItem_Click(object sender, EventArgs e)
{
cbx_item.DroppedDown = true;
}
}
}

View File

@@ -0,0 +1,108 @@
namespace Controls
{
partial class CComboBox
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CComboBox));
this.cbx_item = new System.Windows.Forms.ComboBox();
this.lbl_line = new System.Windows.Forms.Label();
this.btn_showItem = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// cbx_item
//
this.cbx_item.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.cbx_item.BackColor = System.Drawing.Color.White;
this.cbx_item.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbx_item.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cbx_item.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.cbx_item.FormattingEnabled = true;
this.cbx_item.Location = new System.Drawing.Point(2, -3);
this.cbx_item.Margin = new System.Windows.Forms.Padding(0);
this.cbx_item.Name = "cbx_item";
this.cbx_item.Size = new System.Drawing.Size(120, 25);
this.cbx_item.TabIndex = 10;
this.cbx_item.TabStop = false;
this.cbx_item.SelectedIndexChanged += new System.EventHandler(this.cbx_item_SelectedIndexChanged);
//
// lbl_line
//
this.lbl_line.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lbl_line.BackColor = System.Drawing.Color.Gray;
this.lbl_line.Location = new System.Drawing.Point(3, 20);
this.lbl_line.Name = "lbl_line";
this.lbl_line.Size = new System.Drawing.Size(120, 1);
this.lbl_line.TabIndex = 11;
//
// btn_showItem
//
this.btn_showItem.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btn_showItem.BackColor = System.Drawing.Color.White;
this.btn_showItem.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.btn_showItem.FlatAppearance.BorderColor = System.Drawing.Color.White;
this.btn_showItem.FlatAppearance.BorderSize = 0;
this.btn_showItem.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Gray;
this.btn_showItem.FlatAppearance.MouseOverBackColor = System.Drawing.Color.DarkGray;
this.btn_showItem.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_showItem.Image = ((System.Drawing.Image)(resources.GetObject("btn_showItem.Image")));
this.btn_showItem.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
this.btn_showItem.Location = new System.Drawing.Point(103, -1);
this.btn_showItem.Margin = new System.Windows.Forms.Padding(0);
this.btn_showItem.Name = "btn_showItem";
this.btn_showItem.Size = new System.Drawing.Size(17, 20);
this.btn_showItem.TabIndex = 12;
this.btn_showItem.UseVisualStyleBackColor = false;
this.btn_showItem.Click += new System.EventHandler(this.btn_showItem_Click);
//
// CComboBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.Controls.Add(this.btn_showItem);
this.Controls.Add(this.lbl_line);
this.Controls.Add(this.cbx_item);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Margin = new System.Windows.Forms.Padding(0);
this.Name = "CComboBox";
this.Size = new System.Drawing.Size(120, 22);
this.Enter += new System.EventHandler(this.ComboBox_Enter);
this.Leave += new System.EventHandler(this.ComboBox_Leave);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ComboBox cbx_item;
private System.Windows.Forms.Label lbl_line;
private System.Windows.Forms.Button btn_showItem;
}
}

View File

@@ -0,0 +1,128 @@
<?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="btn_showItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAABGdBTUEAALGPC/xhBQAAADlJREFUKFNj
6OrqMuju7q7HhkFyYAWdnZ0fgPR/ZAwVM2AAARADWRGKJAzAFGGVhAGQBE5JWgEGBgBpDD29jSJy5QAA
AABJRU5ErkJggg==
</value>
</data>
</root>

View File

@@ -0,0 +1,77 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Controls
{
public partial class CNumeric : UserControl
{
public CNumeric()
{
InitializeComponent();
tbx_value.Text = _value.ToString();
}
/// <summary>
/// 值改变事件
/// </summary>
public event DValueChanged ValueChanged;
/// <summary>
/// 值
/// </summary>
private string _value = string.Empty;
public string Value
{
get
{
return _value;
}
set
{
_value = value;
tbx_value.Text = value.ToString();
}
}
private void tbx_value_KeyPress(object sender, KeyPressEventArgs e)
{
try
{
/*只能数字键、退格键、负号、小数点*/
if (((int)e.KeyChar < 48 || (int)e.KeyChar > 57) && (int)e.KeyChar != 8 &&
(int)e.KeyChar != 45 && (int)e.KeyChar != 46) e.Handled = true;
/*输入为负号和小数点时,且只能输入一次(负号只能最前面输入,小数点不可最前面输入)*/
if (e.KeyChar == 45 && (((TextBox)sender).SelectionStart != 0 ||
((TextBox)sender).Text.IndexOf("-") >= 0)) e.Handled = true;
if (e.KeyChar == 46 && (((TextBox)sender).SelectionStart == 0 ||
((TextBox)sender).Text.IndexOf(".") >= 0)) e.Handled = true;
}
catch { }
}
private void Numeric_Enter(object sender, EventArgs e)
{
lbl_line.Height = 2;
lbl_line.BackColor = Color.FromArgb(18, 150, 219);
}
private void Numeric_Leave(object sender, EventArgs e)
{
lbl_line.Height = 1;
lbl_line.BackColor = Color.Gray;
}
private void tbx_value_TextChanged(object sender, EventArgs e)
{
if (tbx_value.Text != string.Empty && tbx_value.Text != Value.ToString())
Value = tbx_value.Text;
if (ValueChanged != null)
ValueChanged(Convert.ToDouble(Value));
}
}
}

View File

@@ -0,0 +1,79 @@
namespace Controls
{
partial class CNumeric
{
/// <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.lbl_line = new System.Windows.Forms.Label();
this.tbx_value = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// lbl_line
//
this.lbl_line.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.lbl_line.BackColor = System.Drawing.Color.Gray;
this.lbl_line.Location = new System.Drawing.Point(0, 20);
this.lbl_line.Name = "lbl_line";
this.lbl_line.Size = new System.Drawing.Size(120, 1);
this.lbl_line.TabIndex = 8;
//
// tbx_value
//
this.tbx_value.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.tbx_value.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.tbx_value.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.tbx_value.Location = new System.Drawing.Point(3, 0);
this.tbx_value.Name = "tbx_value";
this.tbx_value.Size = new System.Drawing.Size(114, 16);
this.tbx_value.TabIndex = 9;
this.tbx_value.TextChanged += new System.EventHandler(this.tbx_value_TextChanged);
this.tbx_value.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tbx_value_KeyPress);
//
// CNumeric
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.Controls.Add(this.tbx_value);
this.Controls.Add(this.lbl_line);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.Name = "CNumeric";
this.Size = new System.Drawing.Size(121, 22);
this.Enter += new System.EventHandler(this.Numeric_Enter);
this.Leave += new System.EventHandler(this.Numeric_Leave);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label lbl_line;
private System.Windows.Forms.TextBox tbx_value;
}
}

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>

View File

@@ -0,0 +1,193 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Text.RegularExpressions;
using Controls.Properties;
namespace Controls
{
public delegate void DValueChanged(double value);
public partial class CNumericUpDown : UserControl
{
public CNumericUpDown()
{
InitializeComponent();
nud_value.Text = Value.ToString();
}
/// <summary>
/// 值改变事件
/// </summary>
public event DValueChanged ValueChanged;
/// <summary>
/// 点击一下值的变化量
/// </summary>
private decimal _incremeent = 1;
public decimal Incremeent
{
get { return _incremeent; }
set { _incremeent = value; }
}
/// <summary>
/// 小数位数
/// </summary>
private int _decimalPlaces = 0;
public int DecimalPlaces
{
get { return _decimalPlaces; }
set
{
_decimalPlaces = value;
nud_value.DecimalPlaces = value;
}
}
/// <summary>
/// 最小值
/// </summary>
private decimal _minValue = 0;
public decimal MinValue
{
get { return _minValue; }
set
{
_minValue = value;
nud_value.Minimum = value;
}
}
/// <summary>
/// 最大值
/// </summary>
private decimal _maxValue = 100;
public decimal MaxValue
{
get { return _maxValue; }
set
{
_maxValue = value;
nud_value.Maximum = value;
}
}
/// <summary>
/// 值
/// </summary>
private double _value = 0;
public double Value
{
get
{
return _value;
}
set
{
_value = value;
nud_value.Text = value.ToString();
}
}
private void btn_add_MouseEnter(object sender, EventArgs e)
{
try
{
btn_add.BringToFront();
if (nud_value.Value < MaxValue)
{
btn_add.FlatAppearance.MouseDownBackColor = Color.Gray;
btn_add.FlatAppearance.MouseOverBackColor = Color.DarkGray;
btn_add.Image = Resources.blueAdd;
}
else
{
btn_add.FlatAppearance.MouseDownBackColor = Color.White;
btn_add.FlatAppearance.MouseOverBackColor = Color.White;
}
}
catch { }
}
private void btn_add_MouseLeave(object sender, EventArgs e)
{
btn_add.Image = Resources.grayAdd;
}
private void btn_sub_MouseEnter(object sender, EventArgs e)
{
try
{
btn_sub.BringToFront();
if (nud_value.Value >= MinValue)
{
btn_sub.FlatAppearance.MouseDownBackColor = Color.Gray;
btn_sub.FlatAppearance.MouseOverBackColor = Color.DarkGray;
btn_sub.Image = Resources.blueSub;
}
else
{
btn_sub.FlatAppearance.MouseDownBackColor = Color.White;
btn_sub.FlatAppearance.MouseOverBackColor = Color.White;
}
}
catch { }
}
private void btn_add_Click(object sender, EventArgs e)
{
try
{
if (nud_value.Value + Incremeent <= MaxValue)
nud_value.Text = (nud_value.Value + Incremeent).ToString();
if (nud_value.Value >= MaxValue)
{
btn_add.FlatAppearance.MouseDownBackColor = Color.White;
btn_add.FlatAppearance.MouseOverBackColor = Color.White;
btn_add.Image = Resources.grayAdd;
}
}
catch { }
}
private void btn_sub_Click(object sender, EventArgs e)
{
try
{
if (nud_value.Value + Incremeent > MinValue)
nud_value.Text = (nud_value.Value - Incremeent).ToString();
if (nud_value.Value <= MinValue)
{
btn_sub.FlatAppearance.MouseDownBackColor = Color.White;
btn_sub.FlatAppearance.MouseOverBackColor = Color.White;
btn_sub.Image = Resources.graySub;
}
}
catch { }
}
private void nud_value_ValueChanged(object sender, EventArgs e)
{
Value = (double)nud_value.Value;
if (ValueChanged != null)
ValueChanged(Value);
}
private void UserControl1_Leave(object sender, EventArgs e)
{
lbl_line.Height = 1;
lbl_line.BackColor = Color.Gray;
}
private void UserControl1_Enter(object sender, EventArgs e)
{
lbl_line.Height = 2;
lbl_line.BackColor = Color.FromArgb(18, 150, 219);
}
private void btn_sub_MouseLeave(object sender, EventArgs e)
{
btn_sub.Image = Resources.graySub;
}
}
}

View File

@@ -0,0 +1,133 @@
namespace Controls
{
partial class CNumericUpDown
{
/// <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.btn_add = new System.Windows.Forms.Button();
this.btn_sub = new System.Windows.Forms.Button();
this.lbl_line = new System.Windows.Forms.Label();
this.nud_value = new System.Windows.Forms.NumericUpDown();
((System.ComponentModel.ISupportInitialize)(this.nud_value)).BeginInit();
this.SuspendLayout();
//
// btn_add
//
this.btn_add.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btn_add.BackColor = System.Drawing.Color.White;
this.btn_add.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.btn_add.FlatAppearance.BorderSize = 0;
this.btn_add.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Gray;
this.btn_add.FlatAppearance.MouseOverBackColor = System.Drawing.Color.DarkGray;
this.btn_add.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_add.Image = global::Controls.Properties.Resources.grayAdd;
this.btn_add.Location = new System.Drawing.Point(119, 0);
this.btn_add.Margin = new System.Windows.Forms.Padding(3, 6, 3, 6);
this.btn_add.Name = "btn_add";
this.btn_add.Size = new System.Drawing.Size(20, 23);
this.btn_add.TabIndex = 7;
this.btn_add.TabStop = false;
this.btn_add.UseVisualStyleBackColor = false;
this.btn_add.Click += new System.EventHandler(this.btn_add_Click);
this.btn_add.MouseEnter += new System.EventHandler(this.btn_add_MouseEnter);
this.btn_add.MouseLeave += new System.EventHandler(this.btn_add_MouseLeave);
//
// btn_sub
//
this.btn_sub.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btn_sub.BackColor = System.Drawing.Color.White;
this.btn_sub.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.btn_sub.FlatAppearance.BorderSize = 0;
this.btn_sub.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Gray;
this.btn_sub.FlatAppearance.MouseOverBackColor = System.Drawing.Color.DarkGray;
this.btn_sub.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_sub.Image = global::Controls.Properties.Resources.graySub;
this.btn_sub.Location = new System.Drawing.Point(101, 0);
this.btn_sub.Margin = new System.Windows.Forms.Padding(14, 20, 14, 20);
this.btn_sub.Name = "btn_sub";
this.btn_sub.Size = new System.Drawing.Size(20, 23);
this.btn_sub.TabIndex = 6;
this.btn_sub.TabStop = false;
this.btn_sub.UseVisualStyleBackColor = false;
this.btn_sub.Click += new System.EventHandler(this.btn_sub_Click);
this.btn_sub.MouseEnter += new System.EventHandler(this.btn_sub_MouseEnter);
this.btn_sub.MouseLeave += new System.EventHandler(this.btn_sub_MouseLeave);
//
// lbl_line
//
this.lbl_line.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lbl_line.BackColor = System.Drawing.Color.Gray;
this.lbl_line.Location = new System.Drawing.Point(3, 24);
this.lbl_line.Name = "lbl_line";
this.lbl_line.Size = new System.Drawing.Size(137, 1);
this.lbl_line.TabIndex = 5;
//
// nud_value
//
this.nud_value.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.nud_value.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.nud_value.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.nud_value.Location = new System.Drawing.Point(6, 4);
this.nud_value.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.nud_value.Name = "nud_value";
this.nud_value.Size = new System.Drawing.Size(130, 19);
this.nud_value.TabIndex = 8;
this.nud_value.ValueChanged += new System.EventHandler(this.nud_value_ValueChanged);
//
// CNumericUpDown
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.Controls.Add(this.btn_add);
this.Controls.Add(this.btn_sub);
this.Controls.Add(this.lbl_line);
this.Controls.Add(this.nud_value);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.MaximumSize = new System.Drawing.Size(300, 26);
this.MinimumSize = new System.Drawing.Size(50, 26);
this.Name = "CNumericUpDown";
this.Size = new System.Drawing.Size(140, 26);
this.Enter += new System.EventHandler(this.UserControl1_Enter);
this.Leave += new System.EventHandler(this.UserControl1_Leave);
((System.ComponentModel.ISupportInitialize)(this.nud_value)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button btn_add;
private System.Windows.Forms.Button btn_sub;
private System.Windows.Forms.Label lbl_line;
private System.Windows.Forms.NumericUpDown nud_value;
}
}

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>

View File

@@ -0,0 +1,75 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Controls.Properties;
namespace Controls
{
public partial class CRadioBox : UserControl
{
public CRadioBox()
{
InitializeComponent();
ckb_box.Text = TextStr;
}
/// <summary>
/// 状态改变事件
/// </summary>
public event DCheckChanged CheckChanged;
/// <summary>
/// 勾选状态
/// </summary>
private bool _checked = false;
public bool Checked
{
get { return _checked; }
set
{
_checked = value;
ckb_box.Checked = value;
}
}
/// <summary>
/// 文本
/// </summary>
private string _textStr = "复选框";
public string TextStr
{
get { return _textStr; }
set
{
_textStr = value;
ckb_box.Text = value;
}
}
private void pic_image_Click(object sender, EventArgs e)
{
ckb_box.Checked = !ckb_box.Checked;
}
private void ckb_box_CheckedChanged(object sender, EventArgs e)
{
if (ckb_box.Checked)
{
pic_image.Image = Resources.;
Checked = true;
}
else
{
pic_image.Image = Resources.;
Checked = false;
}
if (CheckChanged != null)
CheckChanged(ckb_box.Checked);
}
}
}

View File

@@ -0,0 +1,86 @@
namespace Controls
{
partial class CRadioBox
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CRadioBox));
this.pic_image = new System.Windows.Forms.PictureBox();
this.ckb_box = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.pic_image)).BeginInit();
this.SuspendLayout();
//
// pic_image
//
this.pic_image.Image = ((System.Drawing.Image)(resources.GetObject("pic_image.Image")));
this.pic_image.Location = new System.Drawing.Point(2, 2);
this.pic_image.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.pic_image.Name = "pic_image";
this.pic_image.Padding = new System.Windows.Forms.Padding(1);
this.pic_image.Size = new System.Drawing.Size(20, 20);
this.pic_image.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pic_image.TabIndex = 0;
this.pic_image.TabStop = false;
this.pic_image.Click += new System.EventHandler(this.pic_image_Click);
//
// ckb_box
//
this.ckb_box.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.ckb_box.BackColor = System.Drawing.Color.White;
this.ckb_box.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.ckb_box.Location = new System.Drawing.Point(7, 4);
this.ckb_box.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.ckb_box.Name = "ckb_box";
this.ckb_box.Size = new System.Drawing.Size(91, 23);
this.ckb_box.TabIndex = 1;
this.ckb_box.Text = "复选框";
this.ckb_box.UseVisualStyleBackColor = false;
this.ckb_box.CheckedChanged += new System.EventHandler(this.ckb_box_CheckedChanged);
//
// RadioBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.Controls.Add(this.pic_image);
this.Controls.Add(this.ckb_box);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.Name = "RadioBox";
this.Size = new System.Drawing.Size(97, 24);
((System.ComponentModel.ISupportInitialize)(this.pic_image)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.PictureBox pic_image;
private System.Windows.Forms.CheckBox ckb_box;
}
}

View File

@@ -0,0 +1,157 @@
<?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="pic_image.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABGdBTUEAALGPC/xhBQAAByJJREFUeF7t
netRJTcQhQnBITgEMrAzWDJYMoAMzL8t4AdkgDMwGUAGOAOTAWSwPofq67rIgouk1nPOqfrqsgsjtdSt
x0iauUeSJEmSJEmSJElr6+bm5perq6vfYvz48eNX+zNpVtGJ5tCzy8vLG3w+4PMffP5M5AXw2pvr6+s/
8LMCZESxRcNB38zZT+a8algw3eHzuwKik6yVn4HqDj8EA8KC79jMk2qILZ2tDvwVOmEgGJBntNXMlkpl
rf0OcEyOVfqo3GmIKNCe42OVOxMPmKP8bsWSDmkhx4coEA7JbrdilbcMnDBqjhCILYOz6ViFLcoLJ7RW
/O3KZvYjz+pr87DZiSJbPSpgtpl9DdgbnFi1bENbGOtT4dzAqmddsctHYR/Cwov/eFp2SEDhjlnAvcKK
OBwW11pWZoGsYLECi/+zThBospcN6+zUqnFOsQB7BRJ5zBkEMJzdfqxAIp25ggAGa8z3ZZ45AQ01g2MF
EfmMHwS2tLulNf3WvAy9kQQDtchTnwer7rGEln8RMVZUgHVt1T6G7F4/aqyoA+vcqr+vbH1fk772jDEf
QHe05f383vSdD8D5JxGjREPoA3NHW+mWbwzogy5DATLWrH8Q6AtzSxvZ0e2oMaIPTQ+SIOL+jBkh0kA9
vuLzFpzyto7g/05Yv/a76HUxeI25p67U+n2gwz4bu+32+jG87jOa9AI0PJa5SOLL27v42y8HQfVeQK3f
haS9fdZ5ynBQtRdQ6y8m62BHSr3jb+vcEdiYpCXffLJP9dCpkfQ+4sUu8xUS1vm+TODAc6vGLOH61BVX
/yNkSFR7/Rmw+7YqzFZiD0Du7VIfafKXh4fzKaYTS/8zXJeHkSAXK6IZiThezqeQVvKeC64pGnbeCQnq
ka4EnJ1/HsvjCzxaEmWy2X8sAxHB0/k29GbfebkMA0hIs/8v4ul8a3hFPS/sKT8rwELFEhfvGc35xq0l
mS8UTIc+DjCo88mTJZsn3f4dZmDnv1E0D9Bx788Z3fmk6Pg4CqhjXx8wg/ON/GVhXOy2AIQKe2WlgXPA
Uy8MrqQDD6PAclgVFauy82lr/u4gEvBy0P1H+9R2DOrvyDWj4rbOXtv5Rv6CEC4u3v79amvh38WuHwkG
atGkak+NnE/y7wQiiaWS1FpGDgJP51NIs9nuqmWZrlhiKeQcTxoxCCo4v+nb0C3bNDmsAWSPlSMFwezO
J5Z1mkrXAFBxRWfTRgiCFZxPstYCegcA1TMIVnE+6RUALvfKPYJgJeeTLgEA3F5g0DIIVnM+6RUALsMA
RYfQMbE8PFnR+aRbABgu77arHQSrOp9kBQAu9HrVq9tQUCsIVna+kdcIIwnl8jRqEGzA+f1WAgNGDILn
1Z1PzLx04eLnMLFChgkCXMsnbt3evYu0hnQ+MRPThYtr7Nd3D4ItOR8UbQfXeiKoWxBszPksb/6CHC6u
eSSseRBszfmEPjRz0+W4FvARzYJgi84nKHf+wyGNjoVXD4KtOt8oKzcS8L4TiFH2AMOekNaxOfwt7S07
n2U3s/OFRFptxNxZlsVCWm9BsGXnG+UHWFGJLV8I7RoExP5ZLNpmNk4DfFf+jgCOq7HEK+IWBF6iTYGN
U5BzJjMqRFLyYkshwwQBbQlsm4VnK0K52JVEMqhN9yCgDYFN0wCfuT291PMp4W5BwLwDW2bDbf7zJiTY
6zm+5kHAPAMbZsOv+98JifZ8VUyzIGBeQd7T4TL7D9XhbiCkehAwjyDPKXGb/YfixCKWYUOqBQHTDvKa
Fd+3hO6r42RwH/cgYJpBHtOSdQA0RQP0AsQtCJhWkPbM+Lwc8jMN0guQ4iBgGkGaU1O99e+EzO7DzDuR
HQS8Nkhrduq3/p0G6gXIQ8p5ArubWc357Vr/TpgLjPQGsRfYc/Dki51wavFalqZwXmZFbCdrSS0Oi6Tw
hMr4vt8jsLeC47/hd0t+4QXK+5rSA7qKrS5mlGiK/9fDpAgGTPmuv0VoN/H7SOx+2A1FjBMVsTr33fHL
lU2uooaKOnD4teofQzBI7xVuR/n3ANQQgqD10bHNwTq26h5Pg94aLgPH/WpbvV6Coe8ezBA+WJ2OMek7
JBqqIPBjKufvBKO1SORH38WeXNHwoCAinTmdvxPXCDQcpGN1Nrfzd0JBNCdIYMox/5BYIAXBYZZ0/k62
TqDNo4957La121KIci0bB7BOrHq2IRSYXx23+SGBddD8ONcosrOFWx4SttHlHxJ7A1TGlvYQnllmK75E
2QSx1osphwGOv1Cr/0QcFlBJIzx95ArLNPxO3khaJRDk+ELNGAiw9+2LsuV4R9kc4RQVO/KpIz4yd6ox
vrLYslDRtyMEA20A52rtnbTXM3CYqH4raUHH4DtRSx9QbIm2Bc1X2/G28hE/56w4Mph47QXTYppy+AKi
E+nMGHKwJEmSJEmSJEmr6+joX4ihrIv2m0xeAAAAAElFTkSuQmCC
</value>
</data>
</root>

View File

@@ -0,0 +1,190 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Controls.Properties;
namespace Controls
{
public delegate void DTextStrChanged(string textStr);
public partial class CTextBox : UserControl
{
public CTextBox()
{
InitializeComponent();
tbx_text.Text = DefaultText;
//if (PasswordChar && tbx_text.Text != DefaultText)
//{
//}
//else
//{
//}
//if (PasswordChar)
//{
// tbx_text.PasswordChar = '*';
// btn_eye.Visible = true;
//}
//else
//{
//}
if (!PasswordChar)
{
tbx_text.PasswordChar = '\0';
btn_eye.Visible = false;
}
else
{
tbx_text.PasswordChar = '\0';
btn_eye.Visible = true ;
}
}
/// <summary>
/// 文本改变事件
/// </summary>
public event DTextStrChanged TextStrChanged;
/// <summary>
/// 控件文本
/// </summary>
private string _text = string.Empty;
public string TextStr
{
get
{
return _text;
}
set
{
if (value == string.Empty)
{
tbx_text.PasswordChar = '\0';
tbx_text.ForeColor = Color.DarkGray;
tbx_text.Text = DefaultText;
_text = value;
}
else
{
if (PasswordChar)
tbx_text.PasswordChar = '*';
else
tbx_text.PasswordChar = '\0';
tbx_text.ForeColor = Color.FromArgb(64, 64, 64);
_text = value;
tbx_text.Text = _text;
}
}
}
/// <summary>
/// 默认文本
/// </summary>
private string _defaultText = string.Empty;
public string DefaultText
{
get { return _defaultText; }
set { _defaultText = value; }
}
/// <summary>
/// 是否以密码形式显示
/// </summary>
private bool _passwordChar = false;
public bool PasswordChar
{
get { return _passwordChar; }
set
{
_passwordChar = value;
if (PasswordChar)
{
tbx_text.PasswordChar = '*';
}
else
{
tbx_text.PasswordChar = '\0';
}
}
}
private void TextBox_Enter(object sender, EventArgs e)
{
lbl_line.Height = 2;
lbl_line.BackColor = Color.FromArgb(18, 150, 219);
if (tbx_text.Text == DefaultText)
{
tbx_text.SelectionStart = 0;
tbx_text.SelectionLength = 0;
}
}
private void TextBox_Leave(object sender, EventArgs e)
{
lbl_line.Height = 1;
lbl_line.BackColor = Color.Gray;
}
private void tbx_text_TextChanged(object sender, EventArgs e)
{
if (tbx_text.Text != DefaultText && tbx_text.Text != TextStr)
TextStr = tbx_text.Text;
if (TextStrChanged != null)
TextStrChanged(TextStr);
if (PasswordChar && TextStr != string.Empty)
tbx_text.PasswordChar = '*';
else if (TextStr ==string .Empty )
tbx_text.PasswordChar = '\0';
}
private void tbx_text_KeyDown(object sender, KeyEventArgs e)
{
if (tbx_text.Text == DefaultText && e.KeyCode != Keys.Back)
tbx_text.Text = string.Empty;
}
private void tbx_text_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
if (tbx_text.Text == DefaultText)
{
tbx_text.SelectionStart = 0;
tbx_text.SelectionLength = 0;
}
}
}
private void btn_eye_MouseDown(object sender, MouseEventArgs e)
{
tbx_text.PasswordChar = '\0';
btn_eye.BackgroundImage = Resources.Show;
//tbx_text.Width = tbx_text.Width - 30;
}
private void btn_eye_MouseUp(object sender, MouseEventArgs e)
{
if (TextStr != string.Empty)
tbx_text.PasswordChar = '*';
btn_eye.BackgroundImage = Resources.Hide;
tbx_text.Width = tbx_text.Width + 30;
tbx_text.Focus();
tbx_text.SelectionStart = 0;
tbx_text.SelectionLength = 0;
}
private void TextBox_Load(object sender, EventArgs e)
{
if (!PasswordChar)
{
tbx_text.PasswordChar = '\0';
btn_eye.Visible = false;
}
else
{
tbx_text.PasswordChar = '\0';
btn_eye.Visible = true ;
}
}
}
}

108
UsingControl/Controls/CTextBox.designer.cs generated Normal file
View File

@@ -0,0 +1,108 @@
namespace Controls
{
partial class CTextBox
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CTextBox));
this.lbl_line = new System.Windows.Forms.Label();
this.tbx_text = new System.Windows.Forms.TextBox();
this.btn_eye = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// lbl_line
//
this.lbl_line.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lbl_line.BackColor = System.Drawing.Color.Gray;
this.lbl_line.Location = new System.Drawing.Point(2, 20);
this.lbl_line.Name = "lbl_line";
this.lbl_line.Size = new System.Drawing.Size(133, 1);
this.lbl_line.TabIndex = 10;
//
// tbx_text
//
this.tbx_text.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tbx_text.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.tbx_text.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.tbx_text.Location = new System.Drawing.Point(6, 1);
this.tbx_text.Margin = new System.Windows.Forms.Padding(3, 6, 3, 6);
this.tbx_text.Name = "tbx_text";
this.tbx_text.Size = new System.Drawing.Size(125, 16);
this.tbx_text.TabIndex = 9;
this.tbx_text.TextChanged += new System.EventHandler(this.tbx_text_TextChanged);
this.tbx_text.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tbx_text_KeyDown);
this.tbx_text.MouseUp += new System.Windows.Forms.MouseEventHandler(this.tbx_text_MouseUp);
//
// btn_eye
//
this.btn_eye.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btn_eye.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btn_eye.BackgroundImage")));
this.btn_eye.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.btn_eye.FlatAppearance.BorderSize = 0;
this.btn_eye.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_eye.Location = new System.Drawing.Point(110, 1);
this.btn_eye.Name = "btn_eye";
this.btn_eye.Size = new System.Drawing.Size(21, 18);
this.btn_eye.TabIndex = 11;
this.btn_eye.TabStop = false;
this.btn_eye.UseVisualStyleBackColor = true;
this.btn_eye.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btn_eye_MouseDown);
this.btn_eye.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btn_eye_MouseUp);
//
// CTextBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.Controls.Add(this.btn_eye);
this.Controls.Add(this.lbl_line);
this.Controls.Add(this.tbx_text);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.MaximumSize = new System.Drawing.Size(400, 22);
this.MinimumSize = new System.Drawing.Size(20, 22);
this.Name = "CTextBox";
this.Size = new System.Drawing.Size(137, 22);
this.Load += new System.EventHandler(this.TextBox_Load);
this.Enter += new System.EventHandler(this.TextBox_Enter);
this.Leave += new System.EventHandler(this.TextBox_Leave);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label lbl_line;
private System.Windows.Forms.TextBox tbx_text;
private System.Windows.Forms.Button btn_eye;
}
}

View File

@@ -0,0 +1,131 @@
<?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="btn_eye.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAABGdBTUEAALGPC/xhBQAAAPxJREFUOE/N
kj0KwlAQhHMEj+ARvIDghfIH3sLG0sqktBcsxc5KCVjYKIhIbAQjgrZ+89zEKNhnYNid3XlvN494zUIU
RR1LHX71X8gYhuGD2LaSh76geya/EQTBAMNaOaYW+Ym4iuN4TJyhb6pbPxWVOyDaGM5wS54rJy5KWk+c
owvf97t2tJq2gXu26EvDFL2EE2nVyXfkB2k7+l7FGtVqaH2nq8Op1TVEvs/aKuhmkzJpXWdQlHYNYBsc
TTrDkIImuRcmH5lOYA7Li8q3GUlXoDClWcgoExxCt4HpRBfKZ0e+YY+VYXgSr/Bei1n90/4Coyb1aqx+
mCbA816Kvb06q+4cHAAAAABJRU5ErkJggg==
</value>
</data>
</root>

View File

@@ -0,0 +1,178 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6D2088CB-161B-47FB-9C35-0EE8DE61A3DF}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Controls</RootNamespace>
<AssemblyName>Controls</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CButton.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="CButton.Designer.cs">
<DependentUpon>CButton.cs</DependentUpon>
</Compile>
<Compile Include="CCheckBox.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="CCheckBox.designer.cs">
<DependentUpon>CCheckBox.cs</DependentUpon>
</Compile>
<Compile Include="CComboBox.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="CComboBox.designer.cs">
<DependentUpon>CComboBox.cs</DependentUpon>
</Compile>
<Compile Include="CNumeric.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="CNumeric.designer.cs">
<DependentUpon>CNumeric.cs</DependentUpon>
</Compile>
<Compile Include="CNumericUpDown.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="CNumericUpDown.designer.cs">
<DependentUpon>CNumericUpDown.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="CRadioBox.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="CRadioBox.designer.cs">
<DependentUpon>CRadioBox.cs</DependentUpon>
</Compile>
<Compile Include="CTextBox.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="CTextBox.designer.cs">
<DependentUpon>CTextBox.cs</DependentUpon>
</Compile>
<Service Include="{94E38DFF-614B-4cbd-B67C-F211BB35CE8B}" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="CButton.resx">
<DependentUpon>CButton.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="CCheckBox.resx">
<DependentUpon>CCheckBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="CComboBox.resx">
<DependentUpon>CComboBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="CNumeric.resx">
<DependentUpon>CNumeric.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="CNumericUpDown.resx">
<DependentUpon>CNumericUpDown.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="CRadioBox.resx">
<DependentUpon>CRadioBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="CTextBox.resx">
<DependentUpon>CTextBox.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="Resources\复选框.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\去复选框.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\勾选.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\去勾选.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\grayAdd.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\blueSub.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\graySub.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\blueAdd.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\BlueImage.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\GrayImage.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Hide.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Show.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\ButtonDown.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\ButtonEnter.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\ButtonUp.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Controls")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Controls")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("2eb3123a-4223-4587-83e5-2b1cf8508df3")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,213 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace Controls.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("Controls.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 blueAdd {
get {
object obj = ResourceManager.GetObject("blueAdd", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap BlueImage {
get {
object obj = ResourceManager.GetObject("BlueImage", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap blueSub {
get {
object obj = ResourceManager.GetObject("blueSub", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap ButtonDown {
get {
object obj = ResourceManager.GetObject("ButtonDown", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap ButtonEnter {
get {
object obj = ResourceManager.GetObject("ButtonEnter", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap ButtonUp {
get {
object obj = ResourceManager.GetObject("ButtonUp", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap grayAdd {
get {
object obj = ResourceManager.GetObject("grayAdd", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap GrayImage {
get {
object obj = ResourceManager.GetObject("GrayImage", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap graySub {
get {
object obj = ResourceManager.GetObject("graySub", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap Hide {
get {
object obj = ResourceManager.GetObject("Hide", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap Show {
get {
object obj = ResourceManager.GetObject("Show", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap {
get {
object obj = ResourceManager.GetObject("勾选", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap {
get {
object obj = ResourceManager.GetObject("去勾选", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap {
get {
object obj = ResourceManager.GetObject("去复选框", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap {
get {
object obj = ResourceManager.GetObject("复选框", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@@ -0,0 +1,166 @@
<?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="blueAdd" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\blueAdd.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="BlueImage" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\BlueImage.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="blueSub" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\blueSub.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="grayAdd" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\grayAdd.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="GrayImage" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\GrayImage.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="graySub" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\graySub.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Hide" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Hide.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Show" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Show.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="勾选" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\勾选.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="去勾选" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\去勾选.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="去复选框" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\去复选框.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="复选框" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\复选框.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ButtonDown" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ButtonDown.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ButtonEnter" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ButtonEnter.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ButtonUp" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ButtonUp.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 491 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB