// ***********************************************************************
// Assembly : HZH_Controls
// Created : 09-02-2019
//
// ***********************************************************************
//
// Copyright by Huang Zhenghui(黄正辉) All, QQ group:568015492 QQ:623128629 Email:623128629@qq.com
//
//
// 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
{
///
/// Class UCLEDDataTime.
/// Implements the
///
///
public partial class UCLEDDataTime : UserControl
{
///
/// The m value
///
private DateTime m_value;
///
/// Gets or sets the value.
///
/// The 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];
}
}
}
///
/// The m line width
///
private int m_lineWidth = 8;
///
/// Gets or sets the width of the line.
///
/// The width of the line.
[Description("线宽度,为了更好的显示效果,请使用偶数"), Category("自定义")]
public int LineWidth
{
get { return m_lineWidth; }
set
{
m_lineWidth = value;
foreach (UCLEDNum c in this.tableLayoutPanel1.Controls)
{
c.LineWidth = value;
}
}
}
///
/// 获取或设置控件的前景色。
///
/// The color of the fore.
///
///
///
[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;
}
}
}
///
/// Initializes a new instance of the class.
///
public UCLEDDataTime()
{
InitializeComponent();
Value = DateTime.Now;
}
}
}