mirror of
https://github.com/eggplantlwj/VisionEdit.git
synced 2026-03-25 09:16:34 +08:00
1、优化LOG显示与引用
2、添加PMA工具,工具内容待完善 3、修复流程树显示 4、添加开源项目,优化UI空间 5、其他BUG更改
This commit is contained in:
257
UsingControl/HZHControls/Controls/LED/UCLEDData.Designer.cs
generated
Normal file
257
UsingControl/HZHControls/Controls/LED/UCLEDData.Designer.cs
generated
Normal file
@@ -0,0 +1,257 @@
|
||||
// ***********************************************************************
|
||||
// Assembly : HZH_Controls
|
||||
// Created : 09-02-2019
|
||||
//
|
||||
// ***********************************************************************
|
||||
// <copyright file="UCLEDData.Designer.cs">
|
||||
// Copyright by Huang Zhenghui(黄正辉) All, QQ group:568015492 QQ:623128629 Email:623128629@qq.com
|
||||
// </copyright>
|
||||
//
|
||||
// Blog: https://www.cnblogs.com/bfyx
|
||||
// GitHub:https://github.com/kwwwvagaa/NetWinformControl
|
||||
// gitee:https://gitee.com/kwwwvagaa/net_winform_custom_control.git
|
||||
//
|
||||
// If you use this code, please keep this note.
|
||||
// ***********************************************************************
|
||||
namespace HZH_Controls.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// Class UCLEDData.
|
||||
/// Implements the <see cref="System.Windows.Forms.UserControl" />
|
||||
/// </summary>
|
||||
/// <seealso cref="System.Windows.Forms.UserControl" />
|
||||
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
|
||||
|
||||
/// <summary>
|
||||
/// The table layout panel1
|
||||
/// </summary>
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
/// <summary>
|
||||
/// The d1
|
||||
/// </summary>
|
||||
private UCLEDNum D1;
|
||||
/// <summary>
|
||||
/// The d2
|
||||
/// </summary>
|
||||
private UCLEDNum D2;
|
||||
/// <summary>
|
||||
/// The d3
|
||||
/// </summary>
|
||||
private UCLEDNum D3;
|
||||
/// <summary>
|
||||
/// The d4
|
||||
/// </summary>
|
||||
private UCLEDNum D4;
|
||||
/// <summary>
|
||||
/// The d5
|
||||
/// </summary>
|
||||
private UCLEDNum D5;
|
||||
/// <summary>
|
||||
/// The d6
|
||||
/// </summary>
|
||||
private UCLEDNum D6;
|
||||
/// <summary>
|
||||
/// The d7
|
||||
/// </summary>
|
||||
private UCLEDNum D7;
|
||||
/// <summary>
|
||||
/// The d8
|
||||
/// </summary>
|
||||
private UCLEDNum D8;
|
||||
/// <summary>
|
||||
/// The d9
|
||||
/// </summary>
|
||||
private UCLEDNum D9;
|
||||
/// <summary>
|
||||
/// The D10
|
||||
/// </summary>
|
||||
private UCLEDNum D10;
|
||||
|
||||
}
|
||||
}
|
||||
113
UsingControl/HZHControls/Controls/LED/UCLEDData.cs
Normal file
113
UsingControl/HZHControls/Controls/LED/UCLEDData.cs
Normal file
@@ -0,0 +1,113 @@
|
||||
// ***********************************************************************
|
||||
// Assembly : HZH_Controls
|
||||
// Created : 09-02-2019
|
||||
//
|
||||
// ***********************************************************************
|
||||
// <copyright file="UCLEDData.cs">
|
||||
// Copyright by Huang Zhenghui(黄正辉) All, QQ group:568015492 QQ:623128629 Email:623128629@qq.com
|
||||
// </copyright>
|
||||
//
|
||||
// Blog: https://www.cnblogs.com/bfyx
|
||||
// GitHub:https://github.com/kwwwvagaa/NetWinformControl
|
||||
// gitee:https://gitee.com/kwwwvagaa/net_winform_custom_control.git
|
||||
//
|
||||
// If you use this code, please keep this note.
|
||||
// ***********************************************************************
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// Class UCLEDData.
|
||||
/// Implements the <see cref="System.Windows.Forms.UserControl" />
|
||||
/// </summary>
|
||||
/// <seealso cref="System.Windows.Forms.UserControl" />
|
||||
public partial class UCLEDData : UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// The m value
|
||||
/// </summary>
|
||||
private DateTime m_value;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value.
|
||||
/// </summary>
|
||||
/// <value>The value.</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];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The m line width
|
||||
/// </summary>
|
||||
private int m_lineWidth = 8;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the width of the line.
|
||||
/// </summary>
|
||||
/// <value>The width of the line.</value>
|
||||
[Description("线宽度,为了更好的显示效果,请使用偶数"), Category("自定义")]
|
||||
public int LineWidth
|
||||
{
|
||||
get { return m_lineWidth; }
|
||||
set
|
||||
{
|
||||
m_lineWidth = value;
|
||||
foreach (UCLEDNum c in this.tableLayoutPanel1.Controls)
|
||||
{
|
||||
c.LineWidth = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置控件的前景色。
|
||||
/// </summary>
|
||||
/// <value>The color of the fore.</value>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
[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;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UCLEDData" /> class.
|
||||
/// </summary>
|
||||
public UCLEDData()
|
||||
{
|
||||
InitializeComponent();
|
||||
Value = DateTime.Now;
|
||||
}
|
||||
}
|
||||
}
|
||||
120
UsingControl/HZHControls/Controls/LED/UCLEDData.resx
Normal file
120
UsingControl/HZHControls/Controls/LED/UCLEDData.resx
Normal 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>
|
||||
391
UsingControl/HZHControls/Controls/LED/UCLEDDataTime.Designer.cs
generated
Normal file
391
UsingControl/HZHControls/Controls/LED/UCLEDDataTime.Designer.cs
generated
Normal file
@@ -0,0 +1,391 @@
|
||||
// ***********************************************************************
|
||||
// Assembly : HZH_Controls
|
||||
// Created : 09-02-2019
|
||||
//
|
||||
// ***********************************************************************
|
||||
// <copyright file="UCLEDDataTime.Designer.cs">
|
||||
// Copyright by Huang Zhenghui(黄正辉) All, QQ group:568015492 QQ:623128629 Email:623128629@qq.com
|
||||
// </copyright>
|
||||
//
|
||||
// Blog: https://www.cnblogs.com/bfyx
|
||||
// GitHub:https://github.com/kwwwvagaa/NetWinformControl
|
||||
// gitee:https://gitee.com/kwwwvagaa/net_winform_custom_control.git
|
||||
//
|
||||
// If you use this code, please keep this note.
|
||||
// ***********************************************************************
|
||||
namespace HZH_Controls.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// Class UCLEDDataTime.
|
||||
/// Implements the <see cref="System.Windows.Forms.UserControl" />
|
||||
/// </summary>
|
||||
/// <seealso cref="System.Windows.Forms.UserControl" />
|
||||
partial class UCLEDDataTime
|
||||
{
|
||||
/// <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.D12 = new HZH_Controls.Controls.UCLEDNum();
|
||||
this.D13 = new HZH_Controls.Controls.UCLEDNum();
|
||||
this.D14 = new HZH_Controls.Controls.UCLEDNum();
|
||||
this.D15 = new HZH_Controls.Controls.UCLEDNum();
|
||||
this.D16 = new HZH_Controls.Controls.UCLEDNum();
|
||||
this.D17 = new HZH_Controls.Controls.UCLEDNum();
|
||||
this.D18 = new HZH_Controls.Controls.UCLEDNum();
|
||||
this.D19 = new HZH_Controls.Controls.UCLEDNum();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 19;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5.263158F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5.263158F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5.263158F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5.263158F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5.263158F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5.263158F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5.263158F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5.263158F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5.263158F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5.263158F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5.263158F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5.263158F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5.263158F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5.263158F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5.263158F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5.263158F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5.263158F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5.263158F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5.263158F));
|
||||
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.Controls.Add(this.D12, 11, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.D13, 12, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.D14, 13, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.D15, 14, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.D16, 15, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.D17, 16, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.D18, 17, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.D19, 18, 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(650, 58);
|
||||
this.tableLayoutPanel1.TabIndex = 1;
|
||||
//
|
||||
// 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(28, 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(37, 3);
|
||||
this.D2.Name = "D2";
|
||||
this.D2.Size = new System.Drawing.Size(28, 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(71, 3);
|
||||
this.D3.Name = "D3";
|
||||
this.D3.Size = new System.Drawing.Size(28, 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(105, 3);
|
||||
this.D4.Name = "D4";
|
||||
this.D4.Size = new System.Drawing.Size(28, 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(139, 3);
|
||||
this.D5.Name = "D5";
|
||||
this.D5.Size = new System.Drawing.Size(28, 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(173, 3);
|
||||
this.D6.Name = "D6";
|
||||
this.D6.Size = new System.Drawing.Size(28, 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(207, 3);
|
||||
this.D7.Name = "D7";
|
||||
this.D7.Size = new System.Drawing.Size(28, 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(241, 3);
|
||||
this.D8.Name = "D8";
|
||||
this.D8.Size = new System.Drawing.Size(28, 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(275, 3);
|
||||
this.D9.Name = "D9";
|
||||
this.D9.Size = new System.Drawing.Size(28, 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(309, 3);
|
||||
this.D10.Name = "D10";
|
||||
this.D10.Size = new System.Drawing.Size(28, 52);
|
||||
this.D10.TabIndex = 9;
|
||||
this.D10.Value = '1';
|
||||
//
|
||||
// D12
|
||||
//
|
||||
this.D12.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.D12.LineWidth = 8;
|
||||
this.D12.Location = new System.Drawing.Point(377, 3);
|
||||
this.D12.Name = "D12";
|
||||
this.D12.Size = new System.Drawing.Size(28, 52);
|
||||
this.D12.TabIndex = 10;
|
||||
this.D12.Value = '2';
|
||||
//
|
||||
// D13
|
||||
//
|
||||
this.D13.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.D13.LineWidth = 8;
|
||||
this.D13.Location = new System.Drawing.Point(411, 3);
|
||||
this.D13.Name = "D13";
|
||||
this.D13.Size = new System.Drawing.Size(28, 52);
|
||||
this.D13.TabIndex = 11;
|
||||
this.D13.Value = '3';
|
||||
//
|
||||
// D14
|
||||
//
|
||||
this.D14.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.D14.LineWidth = 8;
|
||||
this.D14.Location = new System.Drawing.Point(445, 3);
|
||||
this.D14.Name = "D14";
|
||||
this.D14.Size = new System.Drawing.Size(28, 52);
|
||||
this.D14.TabIndex = 12;
|
||||
this.D14.Value = ':';
|
||||
//
|
||||
// D15
|
||||
//
|
||||
this.D15.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.D15.LineWidth = 8;
|
||||
this.D15.Location = new System.Drawing.Point(479, 3);
|
||||
this.D15.Name = "D15";
|
||||
this.D15.Size = new System.Drawing.Size(28, 52);
|
||||
this.D15.TabIndex = 13;
|
||||
this.D15.Value = '0';
|
||||
//
|
||||
// D16
|
||||
//
|
||||
this.D16.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.D16.LineWidth = 8;
|
||||
this.D16.Location = new System.Drawing.Point(513, 3);
|
||||
this.D16.Name = "D16";
|
||||
this.D16.Size = new System.Drawing.Size(28, 52);
|
||||
this.D16.TabIndex = 14;
|
||||
this.D16.Value = '1';
|
||||
//
|
||||
// D17
|
||||
//
|
||||
this.D17.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.D17.LineWidth = 8;
|
||||
this.D17.Location = new System.Drawing.Point(547, 3);
|
||||
this.D17.Name = "D17";
|
||||
this.D17.Size = new System.Drawing.Size(28, 52);
|
||||
this.D17.TabIndex = 15;
|
||||
this.D17.Value = ':';
|
||||
//
|
||||
// D18
|
||||
//
|
||||
this.D18.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.D18.LineWidth = 8;
|
||||
this.D18.Location = new System.Drawing.Point(581, 3);
|
||||
this.D18.Name = "D18";
|
||||
this.D18.Size = new System.Drawing.Size(28, 52);
|
||||
this.D18.TabIndex = 16;
|
||||
this.D18.Value = '5';
|
||||
//
|
||||
// D19
|
||||
//
|
||||
this.D19.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.D19.LineWidth = 8;
|
||||
this.D19.Location = new System.Drawing.Point(615, 3);
|
||||
this.D19.Name = "D19";
|
||||
this.D19.Size = new System.Drawing.Size(32, 52);
|
||||
this.D19.TabIndex = 17;
|
||||
this.D19.Value = '3';
|
||||
//
|
||||
// UCLEDDataTime
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.Name = "UCLEDDataTime";
|
||||
this.Size = new System.Drawing.Size(650, 58);
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// The table layout panel1
|
||||
/// </summary>
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
/// <summary>
|
||||
/// The d1
|
||||
/// </summary>
|
||||
private UCLEDNum D1;
|
||||
/// <summary>
|
||||
/// The d2
|
||||
/// </summary>
|
||||
private UCLEDNum D2;
|
||||
/// <summary>
|
||||
/// The d3
|
||||
/// </summary>
|
||||
private UCLEDNum D3;
|
||||
/// <summary>
|
||||
/// The d4
|
||||
/// </summary>
|
||||
private UCLEDNum D4;
|
||||
/// <summary>
|
||||
/// The d5
|
||||
/// </summary>
|
||||
private UCLEDNum D5;
|
||||
/// <summary>
|
||||
/// The d6
|
||||
/// </summary>
|
||||
private UCLEDNum D6;
|
||||
/// <summary>
|
||||
/// The d7
|
||||
/// </summary>
|
||||
private UCLEDNum D7;
|
||||
/// <summary>
|
||||
/// The d8
|
||||
/// </summary>
|
||||
private UCLEDNum D8;
|
||||
/// <summary>
|
||||
/// The d9
|
||||
/// </summary>
|
||||
private UCLEDNum D9;
|
||||
/// <summary>
|
||||
/// The D10
|
||||
/// </summary>
|
||||
private UCLEDNum D10;
|
||||
/// <summary>
|
||||
/// The D12
|
||||
/// </summary>
|
||||
private UCLEDNum D12;
|
||||
/// <summary>
|
||||
/// The D13
|
||||
/// </summary>
|
||||
private UCLEDNum D13;
|
||||
/// <summary>
|
||||
/// The D14
|
||||
/// </summary>
|
||||
private UCLEDNum D14;
|
||||
/// <summary>
|
||||
/// The D15
|
||||
/// </summary>
|
||||
private UCLEDNum D15;
|
||||
/// <summary>
|
||||
/// The D16
|
||||
/// </summary>
|
||||
private UCLEDNum D16;
|
||||
/// <summary>
|
||||
/// The D17
|
||||
/// </summary>
|
||||
private UCLEDNum D17;
|
||||
/// <summary>
|
||||
/// The D18
|
||||
/// </summary>
|
||||
private UCLEDNum D18;
|
||||
/// <summary>
|
||||
/// The D19
|
||||
/// </summary>
|
||||
private UCLEDNum D19;
|
||||
}
|
||||
}
|
||||
115
UsingControl/HZHControls/Controls/LED/UCLEDDataTime.cs
Normal file
115
UsingControl/HZHControls/Controls/LED/UCLEDDataTime.cs
Normal file
@@ -0,0 +1,115 @@
|
||||
// ***********************************************************************
|
||||
// Assembly : HZH_Controls
|
||||
// Created : 09-02-2019
|
||||
//
|
||||
// ***********************************************************************
|
||||
// <copyright file="UCLEDDataTime.cs">
|
||||
// Copyright by Huang Zhenghui(黄正辉) All, QQ group:568015492 QQ:623128629 Email:623128629@qq.com
|
||||
// </copyright>
|
||||
//
|
||||
// Blog: https://www.cnblogs.com/bfyx
|
||||
// GitHub:https://github.com/kwwwvagaa/NetWinformControl
|
||||
// gitee:https://gitee.com/kwwwvagaa/net_winform_custom_control.git
|
||||
//
|
||||
// If you use this code, please keep this note.
|
||||
// ***********************************************************************
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// Class UCLEDDataTime.
|
||||
/// Implements the <see cref="System.Windows.Forms.UserControl" />
|
||||
/// </summary>
|
||||
/// <seealso cref="System.Windows.Forms.UserControl" />
|
||||
public partial class UCLEDDataTime : UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// The m value
|
||||
/// </summary>
|
||||
private DateTime m_value;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value.
|
||||
/// </summary>
|
||||
/// <value>The value.</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];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The m line width
|
||||
/// </summary>
|
||||
private int m_lineWidth = 8;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the width of the line.
|
||||
/// </summary>
|
||||
/// <value>The width of the line.</value>
|
||||
[Description("线宽度,为了更好的显示效果,请使用偶数"), Category("自定义")]
|
||||
public int LineWidth
|
||||
{
|
||||
get { return m_lineWidth; }
|
||||
set
|
||||
{
|
||||
m_lineWidth = value;
|
||||
foreach (UCLEDNum c in this.tableLayoutPanel1.Controls)
|
||||
{
|
||||
c.LineWidth = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置控件的前景色。
|
||||
/// </summary>
|
||||
/// <value>The color of the fore.</value>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
[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;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UCLEDDataTime" /> class.
|
||||
/// </summary>
|
||||
public UCLEDDataTime()
|
||||
{
|
||||
InitializeComponent();
|
||||
Value = DateTime.Now;
|
||||
}
|
||||
}
|
||||
}
|
||||
120
UsingControl/HZHControls/Controls/LED/UCLEDDataTime.resx
Normal file
120
UsingControl/HZHControls/Controls/LED/UCLEDDataTime.resx
Normal 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>
|
||||
451
UsingControl/HZHControls/Controls/LED/UCLEDNum.cs
Normal file
451
UsingControl/HZHControls/Controls/LED/UCLEDNum.cs
Normal file
@@ -0,0 +1,451 @@
|
||||
// ***********************************************************************
|
||||
// Assembly : HZH_Controls
|
||||
// Created : 09-02-2019
|
||||
//
|
||||
// ***********************************************************************
|
||||
// <copyright file="UCLEDNum.cs">
|
||||
// Copyright by Huang Zhenghui(黄正辉) All, QQ group:568015492 QQ:623128629 Email:623128629@qq.com
|
||||
// </copyright>
|
||||
//
|
||||
// Blog: https://www.cnblogs.com/bfyx
|
||||
// GitHub:https://github.com/kwwwvagaa/NetWinformControl
|
||||
// gitee:https://gitee.com/kwwwvagaa/net_winform_custom_control.git
|
||||
//
|
||||
// If you use this code, please keep this note.
|
||||
// ***********************************************************************
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace HZH_Controls.Controls
|
||||
{
|
||||
/* 显示位置序号
|
||||
* ****1***
|
||||
* * *
|
||||
* 6 2
|
||||
* * *
|
||||
* ****7***
|
||||
* * *
|
||||
* 5 3
|
||||
* * *
|
||||
* ****4***
|
||||
*/
|
||||
/// <summary>
|
||||
/// Class UCLEDNum.
|
||||
/// Implements the <see cref="System.Windows.Forms.UserControl" />
|
||||
/// </summary>
|
||||
/// <seealso cref="System.Windows.Forms.UserControl" />
|
||||
public class UCLEDNum : UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// The m draw rect
|
||||
/// </summary>
|
||||
Rectangle m_drawRect = Rectangle.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The m nums
|
||||
/// </summary>
|
||||
private static Dictionary<char, int[]> m_nums = new Dictionary<char, int[]>();
|
||||
/// <summary>
|
||||
/// Initializes static members of the <see cref="UCLEDNum" /> class.
|
||||
/// </summary>
|
||||
static UCLEDNum()
|
||||
{
|
||||
m_nums['0'] = new int[] { 1, 2, 3, 4, 5, 6 };
|
||||
m_nums['1'] = new int[] { 2, 3 };
|
||||
m_nums['2'] = new int[] { 1, 2, 5, 4, 7 };
|
||||
m_nums['3'] = new int[] { 1, 2, 7, 3, 4 };
|
||||
m_nums['4'] = new int[] { 2, 3, 6, 7 };
|
||||
m_nums['5'] = new int[] { 1, 6, 7, 3, 4 };
|
||||
m_nums['6'] = new int[] { 1, 6, 5, 4, 3, 7 };
|
||||
m_nums['7'] = new int[] { 1, 2, 3 };
|
||||
m_nums['8'] = new int[] { 1, 2, 3, 4, 5, 6, 7 };
|
||||
m_nums['9'] = new int[] { 1, 2, 3, 4, 7, 6 };
|
||||
m_nums['A'] = new int[] { 1, 2, 3, 5, 6, 7 };
|
||||
m_nums['b'] = new int[] { 3, 4, 5, 6, 7 };
|
||||
m_nums['C'] = new int[] { 1, 6, 5, 4 };
|
||||
m_nums['c'] = new int[] { 7, 5, 4 };
|
||||
m_nums['d'] = new int[] { 2, 3, 4, 5, 7 };
|
||||
m_nums['E'] = new int[] { 1, 4, 5, 6, 7 };
|
||||
m_nums['F'] = new int[] { 1, 5, 6, 7 };
|
||||
m_nums['H'] = new int[] { 2, 3, 5, 6, 7 };
|
||||
m_nums['h'] = new int[] { 3, 5, 6, 7 };
|
||||
m_nums['J'] = new int[] { 2, 3, 4 };
|
||||
m_nums['L'] = new int[] { 4, 5, 6 };
|
||||
m_nums['o'] = new int[] { 3, 4, 5, 7 };
|
||||
m_nums['P'] = new int[] { 1, 2, 5, 6, 7 };
|
||||
m_nums['r'] = new int[] { 5, 7 };
|
||||
m_nums['U'] = new int[] { 2, 3, 4, 5, 6 };
|
||||
m_nums['-'] = new int[] { 7 };
|
||||
m_nums[':'] = new int[0];
|
||||
m_nums['.'] = new int[0];
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UCLEDNum" /> class.
|
||||
/// </summary>
|
||||
public UCLEDNum()
|
||||
{
|
||||
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
||||
this.SetStyle(ControlStyles.DoubleBuffer, true);
|
||||
this.SetStyle(ControlStyles.ResizeRedraw, true);
|
||||
this.SetStyle(ControlStyles.Selectable, true);
|
||||
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
|
||||
this.SetStyle(ControlStyles.UserPaint, true);
|
||||
SizeChanged += LEDNum_SizeChanged;
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
Size = new System.Drawing.Size(40, 70);
|
||||
if (m_drawRect == Rectangle.Empty)
|
||||
m_drawRect = new Rectangle(1, 1, this.Width - 2, this.Height - 2);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles the SizeChanged event of the LEDNum control.
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
|
||||
void LEDNum_SizeChanged(object sender, EventArgs e)
|
||||
{
|
||||
m_drawRect = new Rectangle(1, 1, this.Width - 2, this.Height - 2);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The m value
|
||||
/// </summary>
|
||||
private char m_value = '0';
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value.
|
||||
/// </summary>
|
||||
/// <value>The value.</value>
|
||||
[Description("值"), Category("自定义")]
|
||||
public char Value
|
||||
{
|
||||
get { return m_value; }
|
||||
set
|
||||
{
|
||||
if (!m_nums.ContainsKey(value))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (m_value != value)
|
||||
{
|
||||
m_value = value;
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the character value.
|
||||
/// </summary>
|
||||
/// <value>The character value.</value>
|
||||
public LEDNumChar ValueChar
|
||||
{
|
||||
get
|
||||
{
|
||||
return (LEDNumChar)((int)m_value);
|
||||
}
|
||||
set
|
||||
{
|
||||
Value = (char)value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The m line width
|
||||
/// </summary>
|
||||
private int m_lineWidth = 8;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the width of the line.
|
||||
/// </summary>
|
||||
/// <value>The width of the line.</value>
|
||||
[Description("线宽度,为了更好的显示效果,请使用偶数"), Category("自定义")]
|
||||
public int LineWidth
|
||||
{
|
||||
get { return m_lineWidth; }
|
||||
set
|
||||
{
|
||||
m_lineWidth = value;
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置控件的前景色。
|
||||
/// </summary>
|
||||
/// <value>The color of the fore.</value>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
[Description("颜色"), Category("自定义")]
|
||||
public override System.Drawing.Color ForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.ForeColor;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.ForeColor = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 引发 <see cref="E:System.Windows.Forms.Control.Paint" /> 事件。
|
||||
/// </summary>
|
||||
/// <param name="e">包含事件数据的 <see cref="T:System.Windows.Forms.PaintEventArgs" />。</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
e.Graphics.SetGDIHigh();
|
||||
if (m_value == '.')
|
||||
{
|
||||
Rectangle r2 = new Rectangle(m_drawRect.Left + (m_drawRect.Width - m_lineWidth) / 2, m_drawRect.Bottom - m_lineWidth * 2, m_lineWidth, m_lineWidth);
|
||||
e.Graphics.FillRectangle(new SolidBrush(ForeColor), r2);
|
||||
}
|
||||
else if (m_value == ':')
|
||||
{
|
||||
Rectangle r1 = new Rectangle(m_drawRect.Left + (m_drawRect.Width - m_lineWidth) / 2, m_drawRect.Top + (m_drawRect.Height / 2 - m_lineWidth) / 2, m_lineWidth, m_lineWidth);
|
||||
e.Graphics.FillRectangle(new SolidBrush(ForeColor), r1);
|
||||
Rectangle r2 = new Rectangle(m_drawRect.Left + (m_drawRect.Width - m_lineWidth) / 2, m_drawRect.Top + (m_drawRect.Height / 2 - m_lineWidth) / 2 + m_drawRect.Height / 2, m_lineWidth, m_lineWidth);
|
||||
e.Graphics.FillRectangle(new SolidBrush(ForeColor), r2);
|
||||
}
|
||||
else
|
||||
{
|
||||
int[] vs = m_nums[m_value];
|
||||
if (vs.Contains(1))
|
||||
{
|
||||
GraphicsPath path = new GraphicsPath();
|
||||
path.AddLines(new Point[]
|
||||
{
|
||||
new Point(m_drawRect.Left + 2, m_drawRect.Top),
|
||||
new Point(m_drawRect.Right - 2, m_drawRect.Top),
|
||||
new Point(m_drawRect.Right - m_lineWidth-2, m_drawRect.Top+m_lineWidth),
|
||||
new Point(m_drawRect.Left + m_lineWidth+2, m_drawRect.Top+m_lineWidth),
|
||||
new Point(m_drawRect.Left + 2, m_drawRect.Top)
|
||||
});
|
||||
path.CloseAllFigures();
|
||||
e.Graphics.FillPath(new SolidBrush(ForeColor), path);
|
||||
}
|
||||
|
||||
if (vs.Contains(2))
|
||||
{
|
||||
GraphicsPath path = new GraphicsPath();
|
||||
path.AddLines(new Point[]
|
||||
{
|
||||
new Point(m_drawRect.Right, m_drawRect.Top),
|
||||
new Point(m_drawRect.Right, m_drawRect.Top+(m_drawRect.Height-m_lineWidth-4)/2),
|
||||
new Point(m_drawRect.Right-m_lineWidth/2, m_drawRect.Top+(m_drawRect.Height-m_lineWidth-4)/2+m_lineWidth/2),
|
||||
new Point(m_drawRect.Right-m_lineWidth, m_drawRect.Top+(m_drawRect.Height-m_lineWidth-4)/2),
|
||||
new Point(m_drawRect.Right-m_lineWidth, m_drawRect.Top+m_lineWidth),
|
||||
new Point(m_drawRect.Right, m_drawRect.Top)
|
||||
});
|
||||
path.CloseAllFigures();
|
||||
e.Graphics.FillPath(new SolidBrush(ForeColor), path);
|
||||
}
|
||||
|
||||
if (vs.Contains(3))
|
||||
{
|
||||
GraphicsPath path = new GraphicsPath();
|
||||
path.AddLines(new Point[]
|
||||
{
|
||||
new Point(m_drawRect.Right, m_drawRect.Bottom-(m_drawRect.Height-m_lineWidth-4)/2),
|
||||
new Point(m_drawRect.Right, m_drawRect.Bottom),
|
||||
new Point(m_drawRect.Right-m_lineWidth, m_drawRect.Bottom-m_lineWidth),
|
||||
new Point(m_drawRect.Right-m_lineWidth, m_drawRect.Bottom-(m_drawRect.Height-m_lineWidth-4)/2),
|
||||
new Point(m_drawRect.Right-m_lineWidth/2, m_drawRect.Bottom-(m_drawRect.Height-m_lineWidth-4)/2-m_lineWidth/2),
|
||||
new Point(m_drawRect.Right, m_drawRect.Bottom-(m_drawRect.Height-m_lineWidth-4)/2),
|
||||
});
|
||||
path.CloseAllFigures();
|
||||
e.Graphics.FillPath(new SolidBrush(ForeColor), path);
|
||||
}
|
||||
|
||||
if (vs.Contains(4))
|
||||
{
|
||||
GraphicsPath path = new GraphicsPath();
|
||||
path.AddLines(new Point[]
|
||||
{
|
||||
new Point(m_drawRect.Left + 2, m_drawRect.Bottom),
|
||||
new Point(m_drawRect.Right - 2, m_drawRect.Bottom),
|
||||
new Point(m_drawRect.Right - m_lineWidth-2, m_drawRect.Bottom-m_lineWidth),
|
||||
new Point(m_drawRect.Left + m_lineWidth+2, m_drawRect.Bottom-m_lineWidth),
|
||||
new Point(m_drawRect.Left + 2, m_drawRect.Bottom)
|
||||
});
|
||||
path.CloseAllFigures();
|
||||
e.Graphics.FillPath(new SolidBrush(ForeColor), path);
|
||||
}
|
||||
|
||||
if (vs.Contains(5))
|
||||
{
|
||||
GraphicsPath path = new GraphicsPath();
|
||||
path.AddLines(new Point[]
|
||||
{
|
||||
new Point(m_drawRect.Left, m_drawRect.Bottom-(m_drawRect.Height-m_lineWidth-4)/2),
|
||||
new Point(m_drawRect.Left, m_drawRect.Bottom),
|
||||
new Point(m_drawRect.Left+m_lineWidth, m_drawRect.Bottom-m_lineWidth),
|
||||
new Point(m_drawRect.Left+m_lineWidth, m_drawRect.Bottom-(m_drawRect.Height-m_lineWidth-4)/2),
|
||||
new Point(m_drawRect.Left+m_lineWidth/2, m_drawRect.Bottom-(m_drawRect.Height-m_lineWidth-4)/2-m_lineWidth/2),
|
||||
new Point(m_drawRect.Left, m_drawRect.Bottom-(m_drawRect.Height-m_lineWidth-4)/2),
|
||||
});
|
||||
path.CloseAllFigures();
|
||||
e.Graphics.FillPath(new SolidBrush(ForeColor), path);
|
||||
}
|
||||
|
||||
|
||||
if (vs.Contains(6))
|
||||
{
|
||||
GraphicsPath path = new GraphicsPath();
|
||||
path.AddLines(new Point[]
|
||||
{
|
||||
new Point(m_drawRect.Left, m_drawRect.Top),
|
||||
new Point(m_drawRect.Left, m_drawRect.Top+(m_drawRect.Height-m_lineWidth-4)/2),
|
||||
new Point(m_drawRect.Left+m_lineWidth/2, m_drawRect.Top+(m_drawRect.Height-m_lineWidth-4)/2+m_lineWidth/2),
|
||||
new Point(m_drawRect.Left+m_lineWidth, m_drawRect.Top+(m_drawRect.Height-m_lineWidth-4)/2),
|
||||
new Point(m_drawRect.Left+m_lineWidth, m_drawRect.Top+m_lineWidth),
|
||||
new Point(m_drawRect.Left, m_drawRect.Top)
|
||||
});
|
||||
path.CloseAllFigures();
|
||||
e.Graphics.FillPath(new SolidBrush(ForeColor), path);
|
||||
}
|
||||
|
||||
if (vs.Contains(7))
|
||||
{
|
||||
GraphicsPath path = new GraphicsPath();
|
||||
path.AddLines(new Point[]
|
||||
{
|
||||
new Point(m_drawRect.Left+m_lineWidth/2, m_drawRect.Height/2+1),
|
||||
new Point(m_drawRect.Left+m_lineWidth, m_drawRect.Height/2-m_lineWidth/2+1),
|
||||
new Point(m_drawRect.Right-m_lineWidth, m_drawRect.Height/2-m_lineWidth/2+1),
|
||||
new Point(m_drawRect.Right-m_lineWidth/2, m_drawRect.Height/2+1),
|
||||
new Point(m_drawRect.Right-m_lineWidth, m_drawRect.Height/2+m_lineWidth/2+1),
|
||||
new Point(m_drawRect.Left+m_lineWidth, m_drawRect.Height/2+m_lineWidth/2+1),
|
||||
new Point(m_drawRect.Left+m_lineWidth/2, m_drawRect.Height/2+1)
|
||||
});
|
||||
path.CloseAllFigures();
|
||||
e.Graphics.FillPath(new SolidBrush(ForeColor), path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>Enum LEDNumChar</summary>
|
||||
public enum LEDNumChar : int
|
||||
{
|
||||
/// <summary>
|
||||
/// The character 0
|
||||
/// </summary>
|
||||
CHAR_0 = (int)'0',
|
||||
/// <summary>
|
||||
/// The character 1
|
||||
/// </summary>
|
||||
CHAR_1 = (int)'1',
|
||||
/// <summary>
|
||||
/// The character 2
|
||||
/// </summary>
|
||||
CHAR_2 = (int)'2',
|
||||
/// <summary>
|
||||
/// The character 3
|
||||
/// </summary>
|
||||
CHAR_3 = (int)'3',
|
||||
/// <summary>
|
||||
/// The character 4
|
||||
/// </summary>
|
||||
CHAR_4 = (int)'4',
|
||||
CHAR_5 = (int)'5',
|
||||
/// <summary>
|
||||
/// The character 6
|
||||
/// </summary>
|
||||
CHAR_6 = (int)'6',
|
||||
/// <summary>
|
||||
/// The character 7
|
||||
/// </summary>
|
||||
CHAR_7 = (int)'7',
|
||||
/// <summary>
|
||||
/// The character 8
|
||||
/// </summary>
|
||||
CHAR_8 = (int)'8',
|
||||
/// <summary>
|
||||
/// The character 9
|
||||
/// </summary>
|
||||
CHAR_9 = (int)'9',
|
||||
/// <summary>
|
||||
/// The character a
|
||||
/// </summary>
|
||||
CHAR_A = (int)'A',
|
||||
/// <summary>
|
||||
/// The character b
|
||||
/// </summary>
|
||||
CHAR_b = (int)'b',
|
||||
/// <summary>
|
||||
/// The character c
|
||||
/// </summary>
|
||||
CHAR_C = (int)'C',
|
||||
/// <summary>
|
||||
/// The character c
|
||||
/// </summary>
|
||||
CHAR_c = (int)'c',
|
||||
/// <summary>
|
||||
/// The character d
|
||||
/// </summary>
|
||||
CHAR_d = (int)'d',
|
||||
/// <summary>
|
||||
/// The character e
|
||||
/// </summary>
|
||||
CHAR_E = (int)'E',
|
||||
/// <summary>
|
||||
/// The character f
|
||||
/// </summary>
|
||||
CHAR_F = (int)'F',
|
||||
/// <summary>
|
||||
/// The character h
|
||||
/// </summary>
|
||||
CHAR_H = (int)'H',
|
||||
/// <summary>
|
||||
/// The character h
|
||||
/// </summary>
|
||||
CHAR_h = (int)'h',
|
||||
/// <summary>
|
||||
/// The character j
|
||||
/// </summary>
|
||||
CHAR_J = (int)'J',
|
||||
/// <summary>
|
||||
/// The character l
|
||||
/// </summary>
|
||||
CHAR_L = (int)'L',
|
||||
/// <summary>
|
||||
/// The character o
|
||||
/// </summary>
|
||||
CHAR_o = (int)'o',
|
||||
/// <summary>
|
||||
/// The character p
|
||||
/// </summary>
|
||||
CHAR_P = (int)'P',
|
||||
/// <summary>
|
||||
/// The character r
|
||||
/// </summary>
|
||||
CHAR_r = (int)'r',
|
||||
/// <summary>
|
||||
/// The character u
|
||||
/// </summary>
|
||||
CHAR_U = (int)'U',
|
||||
/// <summary>
|
||||
/// The character horizontal line
|
||||
/// </summary>
|
||||
CHAR_HorizontalLine = (int)'-',
|
||||
/// <summary>
|
||||
/// The character colon
|
||||
/// </summary>
|
||||
CHAR_Colon = (int)':',
|
||||
/// <summary>
|
||||
/// The character dot
|
||||
/// </summary>
|
||||
CHAR_Dot = (int)'.',
|
||||
}
|
||||
}
|
||||
65
UsingControl/HZHControls/Controls/LED/UCLEDNums.Designer.cs
generated
Normal file
65
UsingControl/HZHControls/Controls/LED/UCLEDNums.Designer.cs
generated
Normal file
@@ -0,0 +1,65 @@
|
||||
// ***********************************************************************
|
||||
// Assembly : HZH_Controls
|
||||
// Created : 09-02-2019
|
||||
//
|
||||
// ***********************************************************************
|
||||
// <copyright file="UCLEDNums.Designer.cs">
|
||||
// Copyright by Huang Zhenghui(黄正辉) All, QQ group:568015492 QQ:623128629 Email:623128629@qq.com
|
||||
// </copyright>
|
||||
//
|
||||
// Blog: https://www.cnblogs.com/bfyx
|
||||
// GitHub:https://github.com/kwwwvagaa/NetWinformControl
|
||||
// gitee:https://gitee.com/kwwwvagaa/net_winform_custom_control.git
|
||||
//
|
||||
// If you use this code, please keep this note.
|
||||
// ***********************************************************************
|
||||
namespace HZH_Controls.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// Class UCLEDNums.
|
||||
/// Implements the <see cref="System.Windows.Forms.UserControl" />
|
||||
/// </summary>
|
||||
/// <seealso cref="System.Windows.Forms.UserControl" />
|
||||
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
|
||||
}
|
||||
}
|
||||
164
UsingControl/HZHControls/Controls/LED/UCLEDNums.cs
Normal file
164
UsingControl/HZHControls/Controls/LED/UCLEDNums.cs
Normal file
@@ -0,0 +1,164 @@
|
||||
// ***********************************************************************
|
||||
// Assembly : HZH_Controls
|
||||
// Created : 09-02-2019
|
||||
//
|
||||
// ***********************************************************************
|
||||
// <copyright file="UCLEDNums.cs">
|
||||
// Copyright by Huang Zhenghui(黄正辉) All, QQ group:568015492 QQ:623128629 Email:623128629@qq.com
|
||||
// </copyright>
|
||||
//
|
||||
// Blog: https://www.cnblogs.com/bfyx
|
||||
// GitHub:https://github.com/kwwwvagaa/NetWinformControl
|
||||
// gitee:https://gitee.com/kwwwvagaa/net_winform_custom_control.git
|
||||
//
|
||||
// If you use this code, please keep this note.
|
||||
// ***********************************************************************
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// Class UCLEDNums.
|
||||
/// Implements the <see cref="System.Windows.Forms.UserControl" />
|
||||
/// </summary>
|
||||
/// <seealso cref="System.Windows.Forms.UserControl" />
|
||||
public partial class UCLEDNums : UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// The m value
|
||||
/// </summary>
|
||||
private string m_value;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value.
|
||||
/// </summary>
|
||||
/// <value>The value.</value>
|
||||
[Description("值"), Category("自定义")]
|
||||
public string Value
|
||||
{
|
||||
get { return m_value; }
|
||||
set
|
||||
{
|
||||
m_value = value;
|
||||
ReloadValue();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The m line width
|
||||
/// </summary>
|
||||
private int m_lineWidth = 8;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the width of the line.
|
||||
/// </summary>
|
||||
/// <value>The width of the line.</value>
|
||||
[Description("线宽度,为了更好的显示效果,请使用偶数"), Category("自定义")]
|
||||
public int LineWidth
|
||||
{
|
||||
get { return m_lineWidth; }
|
||||
set
|
||||
{
|
||||
m_lineWidth = value;
|
||||
foreach (UCLEDNum c in this.Controls)
|
||||
{
|
||||
c.LineWidth = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置控件的前景色。
|
||||
/// </summary>
|
||||
/// <value>The color of the fore.</value>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
[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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置一个值,该值指示是否将控件的元素对齐以支持使用从右向左的字体的区域设置。
|
||||
/// </summary>
|
||||
/// <value>The right to left.</value>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence" />
|
||||
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
public override RightToLeft RightToLeft
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.RightToLeft;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.RightToLeft = value;
|
||||
ReloadValue();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reloads the value.
|
||||
/// </summary>
|
||||
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);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UCLEDNums" /> class.
|
||||
/// </summary>
|
||||
public UCLEDNums()
|
||||
{
|
||||
InitializeComponent();
|
||||
Value = "0.00";
|
||||
}
|
||||
}
|
||||
}
|
||||
120
UsingControl/HZHControls/Controls/LED/UCLEDNums.resx
Normal file
120
UsingControl/HZHControls/Controls/LED/UCLEDNums.resx
Normal 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>
|
||||
220
UsingControl/HZHControls/Controls/LED/UCLEDTime.Designer.cs
generated
Normal file
220
UsingControl/HZHControls/Controls/LED/UCLEDTime.Designer.cs
generated
Normal file
@@ -0,0 +1,220 @@
|
||||
// ***********************************************************************
|
||||
// Assembly : HZH_Controls
|
||||
// Created : 09-02-2019
|
||||
//
|
||||
// ***********************************************************************
|
||||
// <copyright file="UCLEDTime.Designer.cs">
|
||||
// Copyright by Huang Zhenghui(黄正辉) All, QQ group:568015492 QQ:623128629 Email:623128629@qq.com
|
||||
// </copyright>
|
||||
//
|
||||
// Blog: https://www.cnblogs.com/bfyx
|
||||
// GitHub:https://github.com/kwwwvagaa/NetWinformControl
|
||||
// gitee:https://gitee.com/kwwwvagaa/net_winform_custom_control.git
|
||||
//
|
||||
// If you use this code, please keep this note.
|
||||
// ***********************************************************************
|
||||
namespace HZH_Controls.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// Class UCLEDTime.
|
||||
/// Implements the <see cref="System.Windows.Forms.UserControl" />
|
||||
/// </summary>
|
||||
/// <seealso cref="System.Windows.Forms.UserControl" />
|
||||
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
|
||||
|
||||
/// <summary>
|
||||
/// The table layout panel1
|
||||
/// </summary>
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
/// <summary>
|
||||
/// The d1
|
||||
/// </summary>
|
||||
private UCLEDNum D1;
|
||||
/// <summary>
|
||||
/// The d2
|
||||
/// </summary>
|
||||
private UCLEDNum D2;
|
||||
/// <summary>
|
||||
/// The d3
|
||||
/// </summary>
|
||||
private UCLEDNum D3;
|
||||
/// <summary>
|
||||
/// The d4
|
||||
/// </summary>
|
||||
private UCLEDNum D4;
|
||||
/// <summary>
|
||||
/// The d5
|
||||
/// </summary>
|
||||
private UCLEDNum D5;
|
||||
/// <summary>
|
||||
/// The d6
|
||||
/// </summary>
|
||||
private UCLEDNum D6;
|
||||
/// <summary>
|
||||
/// The d7
|
||||
/// </summary>
|
||||
private UCLEDNum D7;
|
||||
/// <summary>
|
||||
/// The d8
|
||||
/// </summary>
|
||||
private UCLEDNum D8;
|
||||
}
|
||||
}
|
||||
113
UsingControl/HZHControls/Controls/LED/UCLEDTime.cs
Normal file
113
UsingControl/HZHControls/Controls/LED/UCLEDTime.cs
Normal file
@@ -0,0 +1,113 @@
|
||||
// ***********************************************************************
|
||||
// Assembly : HZH_Controls
|
||||
// Created : 09-02-2019
|
||||
//
|
||||
// ***********************************************************************
|
||||
// <copyright file="UCLEDTime.cs">
|
||||
// Copyright by Huang Zhenghui(黄正辉) All, QQ group:568015492 QQ:623128629 Email:623128629@qq.com
|
||||
// </copyright>
|
||||
//
|
||||
// Blog: https://www.cnblogs.com/bfyx
|
||||
// GitHub:https://github.com/kwwwvagaa/NetWinformControl
|
||||
// gitee:https://gitee.com/kwwwvagaa/net_winform_custom_control.git
|
||||
//
|
||||
// If you use this code, please keep this note.
|
||||
// ***********************************************************************
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// Class UCLEDTime.
|
||||
/// Implements the <see cref="System.Windows.Forms.UserControl" />
|
||||
/// </summary>
|
||||
/// <seealso cref="System.Windows.Forms.UserControl" />
|
||||
public partial class UCLEDTime : UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// The m value
|
||||
/// </summary>
|
||||
private DateTime m_value;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value.
|
||||
/// </summary>
|
||||
/// <value>The value.</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];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The m line width
|
||||
/// </summary>
|
||||
private int m_lineWidth = 8;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the width of the line.
|
||||
/// </summary>
|
||||
/// <value>The width of the line.</value>
|
||||
[Description("线宽度,为了更好的显示效果,请使用偶数"), Category("自定义")]
|
||||
public int LineWidth
|
||||
{
|
||||
get { return m_lineWidth; }
|
||||
set
|
||||
{
|
||||
m_lineWidth = value;
|
||||
foreach (UCLEDNum c in this.tableLayoutPanel1.Controls)
|
||||
{
|
||||
c.LineWidth = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置控件的前景色。
|
||||
/// </summary>
|
||||
/// <value>The color of the fore.</value>
|
||||
/// <PermissionSet>
|
||||
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
|
||||
/// </PermissionSet>
|
||||
[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;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UCLEDTime" /> class.
|
||||
/// </summary>
|
||||
public UCLEDTime()
|
||||
{
|
||||
InitializeComponent();
|
||||
Value = DateTime.Now;
|
||||
}
|
||||
}
|
||||
}
|
||||
120
UsingControl/HZHControls/Controls/LED/UCLEDTime.resx
Normal file
120
UsingControl/HZHControls/Controls/LED/UCLEDTime.resx
Normal 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>
|
||||
Reference in New Issue
Block a user