Commit 0d07e236 HZH

add LEDControl

1 个父辈 abbe9a3e
namespace HZH_Controls.Controls
{
partial class UCLEDData
{
/// <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.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.D1 = new HZH_Controls.Controls.UCLEDNum();
this.D2 = new HZH_Controls.Controls.UCLEDNum();
this.D3 = new HZH_Controls.Controls.UCLEDNum();
this.D4 = new HZH_Controls.Controls.UCLEDNum();
this.D5 = new HZH_Controls.Controls.UCLEDNum();
this.D6 = new HZH_Controls.Controls.UCLEDNum();
this.D7 = new HZH_Controls.Controls.UCLEDNum();
this.D8 = new HZH_Controls.Controls.UCLEDNum();
this.D9 = new HZH_Controls.Controls.UCLEDNum();
this.D10 = new HZH_Controls.Controls.UCLEDNum();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 10;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.Controls.Add(this.D1, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.D2, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.D3, 2, 0);
this.tableLayoutPanel1.Controls.Add(this.D4, 3, 0);
this.tableLayoutPanel1.Controls.Add(this.D5, 4, 0);
this.tableLayoutPanel1.Controls.Add(this.D6, 5, 0);
this.tableLayoutPanel1.Controls.Add(this.D7, 6, 0);
this.tableLayoutPanel1.Controls.Add(this.D8, 7, 0);
this.tableLayoutPanel1.Controls.Add(this.D9, 8, 0);
this.tableLayoutPanel1.Controls.Add(this.D10, 9, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(360, 58);
this.tableLayoutPanel1.TabIndex = 0;
//
// D1
//
this.D1.Dock = System.Windows.Forms.DockStyle.Fill;
this.D1.LineWidth = 8;
this.D1.Location = new System.Drawing.Point(3, 3);
this.D1.Name = "D1";
this.D1.Size = new System.Drawing.Size(30, 52);
this.D1.TabIndex = 0;
this.D1.Value = '2';
//
// D2
//
this.D2.Dock = System.Windows.Forms.DockStyle.Fill;
this.D2.LineWidth = 8;
this.D2.Location = new System.Drawing.Point(39, 3);
this.D2.Name = "D2";
this.D2.Size = new System.Drawing.Size(30, 52);
this.D2.TabIndex = 1;
this.D2.Value = '0';
//
// D3
//
this.D3.Dock = System.Windows.Forms.DockStyle.Fill;
this.D3.LineWidth = 8;
this.D3.Location = new System.Drawing.Point(75, 3);
this.D3.Name = "D3";
this.D3.Size = new System.Drawing.Size(30, 52);
this.D3.TabIndex = 2;
this.D3.Value = '1';
//
// D4
//
this.D4.Dock = System.Windows.Forms.DockStyle.Fill;
this.D4.LineWidth = 8;
this.D4.Location = new System.Drawing.Point(111, 3);
this.D4.Name = "D4";
this.D4.Size = new System.Drawing.Size(30, 52);
this.D4.TabIndex = 3;
this.D4.Value = '9';
//
// D5
//
this.D5.Dock = System.Windows.Forms.DockStyle.Fill;
this.D5.LineWidth = 8;
this.D5.Location = new System.Drawing.Point(147, 3);
this.D5.Name = "D5";
this.D5.Size = new System.Drawing.Size(30, 52);
this.D5.TabIndex = 4;
this.D5.Value = '-';
//
// D6
//
this.D6.Dock = System.Windows.Forms.DockStyle.Fill;
this.D6.LineWidth = 8;
this.D6.Location = new System.Drawing.Point(183, 3);
this.D6.Name = "D6";
this.D6.Size = new System.Drawing.Size(30, 52);
this.D6.TabIndex = 5;
this.D6.Value = '0';
//
// D7
//
this.D7.Dock = System.Windows.Forms.DockStyle.Fill;
this.D7.LineWidth = 8;
this.D7.Location = new System.Drawing.Point(219, 3);
this.D7.Name = "D7";
this.D7.Size = new System.Drawing.Size(30, 52);
this.D7.TabIndex = 6;
this.D7.Value = '8';
//
// D8
//
this.D8.Dock = System.Windows.Forms.DockStyle.Fill;
this.D8.LineWidth = 8;
this.D8.Location = new System.Drawing.Point(255, 3);
this.D8.Name = "D8";
this.D8.Size = new System.Drawing.Size(30, 52);
this.D8.TabIndex = 7;
this.D8.Value = '-';
//
// D9
//
this.D9.Dock = System.Windows.Forms.DockStyle.Fill;
this.D9.LineWidth = 8;
this.D9.Location = new System.Drawing.Point(291, 3);
this.D9.Name = "D9";
this.D9.Size = new System.Drawing.Size(30, 52);
this.D9.TabIndex = 8;
this.D9.Value = '0';
//
// D10
//
this.D10.Dock = System.Windows.Forms.DockStyle.Fill;
this.D10.LineWidth = 8;
this.D10.Location = new System.Drawing.Point(327, 3);
this.D10.Name = "D10";
this.D10.Size = new System.Drawing.Size(30, 52);
this.D10.TabIndex = 9;
this.D10.Value = '1';
//
// UCLEDData
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.tableLayoutPanel1);
this.Margin = new System.Windows.Forms.Padding(0);
this.Name = "UCLEDData";
this.Size = new System.Drawing.Size(360, 58);
this.tableLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private UCLEDNum D1;
private UCLEDNum D2;
private UCLEDNum D3;
private UCLEDNum D4;
private UCLEDNum D5;
private UCLEDNum D6;
private UCLEDNum D7;
private UCLEDNum D8;
private UCLEDNum D9;
private UCLEDNum D10;
}
}
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;
namespace HZH_Controls.Controls
{
public partial class UCLEDData : UserControl
{
private DateTime m_value;
[Description("值"), Category("自定义")]
public DateTime Value
{
get { return m_value; }
set
{
m_value = value;
string str = value.ToString("yyyy-MM-dd");
for (int i = 0; i < str.Length; i++)
{
((UCLEDNum)this.tableLayoutPanel1.Controls.Find("D" + (i + 1), false)[0]).Value = str[i];
}
}
}
private int m_lineWidth = 8;
[Description("线宽度,为了更好的显示效果,请使用偶数"), Category("自定义")]
public int LineWidth
{
get { return m_lineWidth; }
set
{
m_lineWidth = value;
foreach (UCLEDNum c in this.tableLayoutPanel1.Controls)
{
c.LineWidth = value;
}
}
}
[Description("颜色"), Category("自定义")]
public override System.Drawing.Color ForeColor
{
get
{
return base.ForeColor;
}
set
{
base.ForeColor = value;
foreach (UCLEDNum c in this.tableLayoutPanel1.Controls)
{
c.ForeColor = value;
}
}
}
public UCLEDData()
{
InitializeComponent();
Value = DateTime.Now;
}
}
}
<?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>
\ No newline at end of file \ No newline at end of file
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;
namespace HZH_Controls.Controls
{
public partial class UCLEDDataTime : UserControl
{
private DateTime m_value;
[Description("值"), Category("自定义")]
public DateTime Value
{
get { return m_value; }
set
{
m_value = value;
string str = value.ToString("yyyy-MM-dd HH:mm:ss");
for (int i = 0; i < str.Length; i++)
{
if (i == 10)
continue;
((UCLEDNum)this.tableLayoutPanel1.Controls.Find("D" + (i + 1), false)[0]).Value = str[i];
}
}
}
private int m_lineWidth = 8;
[Description("线宽度,为了更好的显示效果,请使用偶数"), Category("自定义")]
public int LineWidth
{
get { return m_lineWidth; }
set
{
m_lineWidth = value;
foreach (UCLEDNum c in this.tableLayoutPanel1.Controls)
{
c.LineWidth = value;
}
}
}
[Description("颜色"), Category("自定义")]
public override System.Drawing.Color ForeColor
{
get
{
return base.ForeColor;
}
set
{
base.ForeColor = value;
foreach (UCLEDNum c in this.tableLayoutPanel1.Controls)
{
c.ForeColor = value;
}
}
}
public UCLEDDataTime()
{
InitializeComponent();
Value = DateTime.Now;
}
}
}
<?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>
\ No newline at end of file \ No newline at end of file
namespace HZH_Controls.Controls.LED
{
partial class UCLEDNums
{
/// <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.SuspendLayout();
//
// UCLEDNums
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Name = "UCLEDNums";
this.Size = new System.Drawing.Size(150, 58);
this.ResumeLayout(false);
}
#endregion
}
}
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;
namespace HZH_Controls.Controls.LED
{
public partial class UCLEDNums : UserControl
{
private string m_value;
[Description("值"), Category("自定义")]
public string Value
{
get { return m_value; }
set
{
m_value = value;
ReloadValue();
}
}
private int m_lineWidth = 8;
[Description("线宽度,为了更好的显示效果,请使用偶数"), Category("自定义")]
public int LineWidth
{
get { return m_lineWidth; }
set
{
m_lineWidth = value;
foreach (UCLEDNum c in this.Controls)
{
c.LineWidth = value;
}
}
}
[Description("颜色"), Category("自定义")]
public override System.Drawing.Color ForeColor
{
get
{
return base.ForeColor;
}
set
{
base.ForeColor = value;
foreach (UCLEDNum c in this.Controls)
{
c.ForeColor = value;
}
}
}
public override RightToLeft RightToLeft
{
get
{
return base.RightToLeft;
}
set
{
base.RightToLeft = value;
ReloadValue();
}
}
private void ReloadValue()
{
try
{
ControlHelper.FreezeControl(this, true);
this.Controls.Clear();
foreach (var item in m_value)
{
UCLEDNum uc = new UCLEDNum();
if (RightToLeft == System.Windows.Forms.RightToLeft.Yes)
uc.Dock = DockStyle.Right;
else
uc.Dock = DockStyle.Left;
uc.Value = item;
uc.ForeColor = ForeColor;
uc.LineWidth = m_lineWidth;
this.Controls.Add(uc);
if (RightToLeft == System.Windows.Forms.RightToLeft.Yes)
uc.SendToBack();
else
uc.BringToFront();
}
}
finally
{
ControlHelper.FreezeControl(this, false);
}
}
public UCLEDNums()
{
InitializeComponent();
Value = "0.00";
}
}
}
<?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>
\ No newline at end of file \ No newline at end of file
namespace HZH_Controls.Controls
{
partial class UCLEDTime
{
/// <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.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.D1 = new HZH_Controls.Controls.UCLEDNum();
this.D2 = new HZH_Controls.Controls.UCLEDNum();
this.D3 = new HZH_Controls.Controls.UCLEDNum();
this.D4 = new HZH_Controls.Controls.UCLEDNum();
this.D5 = new HZH_Controls.Controls.UCLEDNum();
this.D6 = new HZH_Controls.Controls.UCLEDNum();
this.D7 = new HZH_Controls.Controls.UCLEDNum();
this.D8 = new HZH_Controls.Controls.UCLEDNum();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 8;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 12.5F));
this.tableLayoutPanel1.Controls.Add(this.D1, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.D2, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.D3, 2, 0);
this.tableLayoutPanel1.Controls.Add(this.D4, 3, 0);
this.tableLayoutPanel1.Controls.Add(this.D5, 4, 0);
this.tableLayoutPanel1.Controls.Add(this.D6, 5, 0);
this.tableLayoutPanel1.Controls.Add(this.D7, 6, 0);
this.tableLayoutPanel1.Controls.Add(this.D8, 7, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(290, 58);
this.tableLayoutPanel1.TabIndex = 0;
//
// D1
//
this.D1.Dock = System.Windows.Forms.DockStyle.Fill;
this.D1.LineWidth = 8;
this.D1.Location = new System.Drawing.Point(3, 3);
this.D1.Name = "D1";
this.D1.Size = new System.Drawing.Size(30, 52);
this.D1.TabIndex = 0;
this.D1.Value = '2';
//
// D2
//
this.D2.Dock = System.Windows.Forms.DockStyle.Fill;
this.D2.LineWidth = 8;
this.D2.Location = new System.Drawing.Point(39, 3);
this.D2.Name = "D2";
this.D2.Size = new System.Drawing.Size(30, 52);
this.D2.TabIndex = 1;
this.D2.Value = '3';
//
// D3
//
this.D3.Dock = System.Windows.Forms.DockStyle.Fill;
this.D3.LineWidth = 8;
this.D3.Location = new System.Drawing.Point(75, 3);
this.D3.Name = "D3";
this.D3.Size = new System.Drawing.Size(30, 52);
this.D3.TabIndex = 2;
this.D3.Value = ':';
//
// D4
//
this.D4.Dock = System.Windows.Forms.DockStyle.Fill;
this.D4.LineWidth = 8;
this.D4.Location = new System.Drawing.Point(111, 3);
this.D4.Name = "D4";
this.D4.Size = new System.Drawing.Size(30, 52);
this.D4.TabIndex = 3;
this.D4.Value = '1';
//
// D5
//
this.D5.Dock = System.Windows.Forms.DockStyle.Fill;
this.D5.LineWidth = 8;
this.D5.Location = new System.Drawing.Point(147, 3);
this.D5.Name = "D5";
this.D5.Size = new System.Drawing.Size(30, 52);
this.D5.TabIndex = 4;
this.D5.Value = '0';
//
// D6
//
this.D6.Dock = System.Windows.Forms.DockStyle.Fill;
this.D6.LineWidth = 8;
this.D6.Location = new System.Drawing.Point(183, 3);
this.D6.Name = "D6";
this.D6.Size = new System.Drawing.Size(30, 52);
this.D6.TabIndex = 5;
this.D6.Value = ':';
//
// D7
//
this.D7.Dock = System.Windows.Forms.DockStyle.Fill;
this.D7.LineWidth = 8;
this.D7.Location = new System.Drawing.Point(219, 3);
this.D7.Name = "D7";
this.D7.Size = new System.Drawing.Size(30, 52);
this.D7.TabIndex = 6;
this.D7.Value = '1';
//
// D8
//
this.D8.Dock = System.Windows.Forms.DockStyle.Fill;
this.D8.LineWidth = 8;
this.D8.Location = new System.Drawing.Point(255, 3);
this.D8.Name = "D8";
this.D8.Size = new System.Drawing.Size(32, 52);
this.D8.TabIndex = 7;
this.D8.Value = '0';
//
// UCLEDTime
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.tableLayoutPanel1);
this.Name = "UCLEDTime";
this.Size = new System.Drawing.Size(290, 58);
this.tableLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private UCLEDNum D1;
private UCLEDNum D2;
private UCLEDNum D3;
private UCLEDNum D4;
private UCLEDNum D5;
private UCLEDNum D6;
private UCLEDNum D7;
private UCLEDNum D8;
}
}
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;
namespace HZH_Controls.Controls
{
public partial class UCLEDTime : UserControl
{
private DateTime m_value;
[Description("值"), Category("自定义")]
public DateTime Value
{
get { return m_value; }
set
{
m_value = value;
string str = value.ToString("HH:mm:ss");
for (int i = 0; i < str.Length; i++)
{
((UCLEDNum)this.tableLayoutPanel1.Controls.Find("D" + (i + 1), false)[0]).Value = str[i];
}
}
}
private int m_lineWidth = 8;
[Description("线宽度,为了更好的显示效果,请使用偶数"), Category("自定义")]
public int LineWidth
{
get { return m_lineWidth; }
set
{
m_lineWidth = value;
foreach (UCLEDNum c in this.tableLayoutPanel1.Controls)
{
c.LineWidth = value;
}
}
}
[Description("颜色"), Category("自定义")]
public override System.Drawing.Color ForeColor
{
get
{
return base.ForeColor;
}
set
{
base.ForeColor = value;
foreach (UCLEDNum c in this.tableLayoutPanel1.Controls)
{
c.ForeColor = value;
}
}
}
public UCLEDTime()
{
InitializeComponent();
Value = DateTime.Now;
}
}
}
<?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>
\ No newline at end of file \ No newline at end of file
...@@ -90,6 +90,33 @@ ...@@ -90,6 +90,33 @@
<Compile Include="Controls\DataGridView\UCDataGridViewTreeRow.Designer.cs"> <Compile Include="Controls\DataGridView\UCDataGridViewTreeRow.Designer.cs">
<DependentUpon>UCDataGridViewTreeRow.cs</DependentUpon> <DependentUpon>UCDataGridViewTreeRow.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Controls\LED\UCLEDDataTime.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\LED\UCLEDDataTime.Designer.cs">
<DependentUpon>UCLEDDataTime.cs</DependentUpon>
</Compile>
<Compile Include="Controls\LED\UCLEDNum.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\LED\UCLEDData.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\LED\UCLEDData.Designer.cs">
<DependentUpon>UCLEDData.cs</DependentUpon>
</Compile>
<Compile Include="Controls\LED\UCLEDNums.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\LED\UCLEDNums.Designer.cs">
<DependentUpon>UCLEDNums.cs</DependentUpon>
</Compile>
<Compile Include="Controls\LED\UCLEDTime.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\LED\UCLEDTime.Designer.cs">
<DependentUpon>UCLEDTime.cs</DependentUpon>
</Compile>
<Compile Include="Controls\List\IListViewItem.cs" /> <Compile Include="Controls\List\IListViewItem.cs" />
<Compile Include="Controls\List\IPageControl.cs" /> <Compile Include="Controls\List\IPageControl.cs" />
<Compile Include="Controls\List\PageControlEventHandler.cs" /> <Compile Include="Controls\List\PageControlEventHandler.cs" />
...@@ -486,6 +513,18 @@ ...@@ -486,6 +513,18 @@
<EmbeddedResource Include="Controls\KeyBord\UCKeyBorderPay.resx"> <EmbeddedResource Include="Controls\KeyBord\UCKeyBorderPay.resx">
<DependentUpon>UCKeyBorderPay.cs</DependentUpon> <DependentUpon>UCKeyBorderPay.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Controls\LED\UCLEDData.resx">
<DependentUpon>UCLEDData.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\LED\UCLEDDataTime.resx">
<DependentUpon>UCLEDDataTime.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\LED\UCLEDNums.resx">
<DependentUpon>UCLEDNums.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\LED\UCLEDTime.resx">
<DependentUpon>UCLEDTime.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\List\UCHorizontalList.resx"> <EmbeddedResource Include="Controls\List\UCHorizontalList.resx">
<DependentUpon>UCHorizontalList.cs</DependentUpon> <DependentUpon>UCHorizontalList.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
......
...@@ -48,6 +48,9 @@ namespace Test ...@@ -48,6 +48,9 @@ namespace Test
Random r = new Random(); Random r = new Random();
int i = r.Next(100, 1000); int i = r.Next(100, 1000);
this.ucWaveWithSource1.AddSource(i.ToString(), i); this.ucWaveWithSource1.AddSource(i.ToString(), i);
ucledDataTime1.Value = DateTime.Now;
ucledTime2.Value = DateTime.Now;
} }
private void trackBar1_Scroll(object sender, EventArgs e) private void trackBar1_Scroll(object sender, EventArgs e)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!