Commit 0dc2f5fe HZH

修改注释信息

1 个父辈 797e8cfe
正在显示 153 个修改的文件 包含 2666 行增加238 行删除
namespace HZH_Controls.Controls
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-08-2019
//
// ***********************************************************************
// <copyright file="UCBtnExt.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 UCBtnExt.
/// Implements the <see cref="HZH_Controls.Controls.UCControlBase" />
/// </summary>
/// <seealso cref="HZH_Controls.Controls.UCControlBase" />
public partial class UCBtnExt
{
/// <summary>
......@@ -82,7 +102,13 @@
#endregion
/// <summary>
/// The label
/// </summary>
public System.Windows.Forms.Label lbl;
/// <summary>
/// The label tips
/// </summary>
private System.Windows.Forms.Label lblTips;
......
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:UCBtnExt.cs
// 创建日期:2019-08-15 15:57:36
// 功能描述:按钮
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-08-2019
//
// ***********************************************************************
// <copyright file="UCBtnExt.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;
......@@ -15,11 +25,20 @@ using System.Windows.Forms;
namespace HZH_Controls.Controls
{
/// <summary>
/// Class UCBtnExt.
/// Implements the <see cref="HZH_Controls.Controls.UCControlBase" />
/// </summary>
/// <seealso cref="HZH_Controls.Controls.UCControlBase" />
[DefaultEvent("BtnClick")]
public partial class UCBtnExt : UCControlBase
{
#region 字段属性
/// <summary>
/// 是否显示角标
/// </summary>
/// <value><c>true</c> if this instance is show tips; otherwise, <c>false</c>.</value>
[Description("是否显示角标"), Category("自定义")]
public bool IsShowTips
{
......@@ -32,7 +51,10 @@ namespace HZH_Controls.Controls
this.lblTips.Visible = value;
}
}
/// <summary>
/// 角标文字
/// </summary>
/// <value>The tips text.</value>
[Description("角标文字"), Category("自定义")]
public string TipsText
{
......@@ -46,7 +68,14 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// The BTN back color
/// </summary>
private Color _btnBackColor = Color.White;
/// <summary>
/// 按钮背景色
/// </summary>
/// <value>The color of the BTN back.</value>
[Description("按钮背景色"), Category("自定义")]
public Color BtnBackColor
{
......@@ -58,10 +87,14 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// The BTN fore color
/// </summary>
private Color _btnForeColor = Color.White;
/// <summary>
/// 按钮字体颜色
/// </summary>
/// <value>The color of the BTN fore.</value>
[Description("按钮字体颜色"), Category("自定义")]
public virtual Color BtnForeColor
{
......@@ -73,10 +106,14 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// The BTN font
/// </summary>
private Font _btnFont = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
/// <summary>
/// 按钮字体
/// </summary>
/// <value>The BTN font.</value>
[Description("按钮字体"), Category("自定义")]
public Font BtnFont
{
......@@ -94,10 +131,14 @@ namespace HZH_Controls.Controls
[Description("按钮点击事件"), Category("自定义")]
public event EventHandler BtnClick;
/// <summary>
/// The BTN text
/// </summary>
private string _btnText;
/// <summary>
/// 按钮文字
/// </summary>
/// <value>The BTN text.</value>
[Description("按钮文字"), Category("自定义")]
public virtual string BtnText
{
......@@ -109,8 +150,14 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// The m tips color
/// </summary>
private Color m_tipsColor = Color.FromArgb(232, 30, 99);
/// <summary>
/// 角标颜色
/// </summary>
/// <value>The color of the tips.</value>
[Description("角标颜色"), Category("自定义")]
public Color TipsColor
{
......@@ -118,6 +165,9 @@ namespace HZH_Controls.Controls
set { m_tipsColor = value; }
}
#endregion
/// <summary>
/// Initializes a new instance of the <see cref="UCBtnExt" /> class.
/// </summary>
public UCBtnExt()
{
InitializeComponent();
......@@ -125,6 +175,11 @@ namespace HZH_Controls.Controls
lblTips.Paint += lblTips_Paint;
}
/// <summary>
/// Handles the Paint event of the lblTips control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="PaintEventArgs" /> instance containing the event data.</param>
void lblTips_Paint(object sender, PaintEventArgs e)
{
e.Graphics.SetGDIHigh();
......@@ -134,6 +189,11 @@ namespace HZH_Controls.Controls
e.Graphics.DrawString(TipsText, lblTips.Font, new SolidBrush(lblTips.ForeColor), new PointF((lblTips.Width - sizeEnd.Width) / 2, (lblTips.Height - sizeEnd.Height) / 2 + 1));
}
/// <summary>
/// Handles the MouseDown event of the lbl control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
private void lbl_MouseDown(object sender, MouseEventArgs e)
{
if (this.BtnClick != null)
......
namespace HZH_Controls.Controls
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-08-2019
//
// ***********************************************************************
// <copyright file="UCBtnFillet.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 UCBtnFillet.
/// Implements the <see cref="HZH_Controls.Controls.UCControlBase" />
/// </summary>
/// <seealso cref="HZH_Controls.Controls.UCControlBase" />
partial class UCBtnFillet
{
/// <summary>
......@@ -62,6 +82,9 @@
#endregion
/// <summary>
/// The label
/// </summary>
private System.Windows.Forms.Label lbl;
}
}
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:UCBtnFillet.cs
// 创建日期:2019-08-15 15:58:03
// 功能描述:按钮
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-08-2019
//
// ***********************************************************************
// <copyright file="UCBtnFillet.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;
......@@ -14,11 +24,23 @@ using System.Windows.Forms;
namespace HZH_Controls.Controls
{
/// <summary>
/// Class UCBtnFillet.
/// Implements the <see cref="HZH_Controls.Controls.UCControlBase" />
/// </summary>
/// <seealso cref="HZH_Controls.Controls.UCControlBase" />
[DefaultEvent("BtnClick")]
public partial class UCBtnFillet : UCControlBase
{
/// <summary>
/// 按钮点击事件
/// </summary>
[Description("按钮点击事件"), Category("自定义")]
public event EventHandler BtnClick;
/// <summary>
/// 按钮图片
/// </summary>
/// <value>The BTN image.</value>
[Description("按钮图片"), Category("自定义")]
public Image BtnImage
{
......@@ -34,6 +56,7 @@ namespace HZH_Controls.Controls
/// <summary>
/// 按钮文字
/// </summary>
/// <value>The BTN text.</value>
[Description("按钮文字"), Category("自定义")]
public string BtnText
{
......@@ -43,11 +66,19 @@ namespace HZH_Controls.Controls
lbl.Text = value;
}
}
/// <summary>
/// Initializes a new instance of the <see cref="UCBtnFillet" /> class.
/// </summary>
public UCBtnFillet()
{
InitializeComponent();
}
/// <summary>
/// Handles the MouseDown event of the lbl control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
private void lbl_MouseDown(object sender, MouseEventArgs e)
{
if (BtnClick != null)
......
namespace HZH_Controls.Controls
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-08-2019
//
// ***********************************************************************
// <copyright file="UCBtnImg.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 UCBtnImg.
/// Implements the <see cref="HZH_Controls.Controls.UCBtnExt" />
/// </summary>
/// <seealso cref="HZH_Controls.Controls.UCBtnExt" />
partial class UCBtnImg
{
/// <summary>
......
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:UCBtnImg.cs
// 创建日期:2019-08-15 15:58:07
// 功能描述:按钮
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-08-2019
//
// ***********************************************************************
// <copyright file="UCBtnImg.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;
......@@ -15,14 +25,20 @@ using System.Windows.Forms;
namespace HZH_Controls.Controls
{
/// <summary>
///
/// Class UCBtnImg.
/// Implements the <see cref="HZH_Controls.Controls.UCBtnExt" />
/// </summary>
/// <seealso cref="HZH_Controls.Controls.UCBtnExt" />
public partial class UCBtnImg : UCBtnExt
{
/// <summary>
/// The BTN text
/// </summary>
private string _btnText = "自定义按钮";
/// <summary>
/// 按钮文字
/// </summary>
/// <value>The BTN text.</value>
[Description("按钮文字"), Category("自定义")]
public override string BtnText
{
......@@ -37,6 +53,7 @@ namespace HZH_Controls.Controls
/// <summary>
/// 图片
/// </summary>
/// <value>The image.</value>
[Description("图片"), Category("自定义")]
public virtual Image Image
{
......@@ -49,14 +66,20 @@ namespace HZH_Controls.Controls
this.lbl.Image = value;
}
}
/// <summary>
/// 图片位置
/// </summary>
/// <value>The image align.</value>
[Description("图片位置"), Category("自定义")]
public virtual ContentAlignment ImageAlign
{
get { return this.lbl.ImageAlign; }
set { lbl.ImageAlign = value; }
}
/// <summary>
/// 文字位置
/// </summary>
/// <value>The text align.</value>
[Description("文字位置"), Category("自定义")]
public virtual ContentAlignment TextAlign
{
......@@ -64,6 +87,9 @@ namespace HZH_Controls.Controls
set { lbl.TextAlign = value; }
}
/// <summary>
/// Initializes a new instance of the <see cref="UCBtnImg" /> class.
/// </summary>
public UCBtnImg()
{
InitializeComponent();
......
namespace HZH_Controls.Controls.Btn
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-27-2019
//
// ***********************************************************************
// <copyright file="UCDropDownBtn.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 UCDropDownBtn.
/// Implements the <see cref="HZH_Controls.Controls.UCBtnImg" />
/// </summary>
/// <seealso cref="HZH_Controls.Controls.UCBtnImg" />
partial class UCDropDownBtn
{
/// <summary>
......
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:UCDropDownBtn.cs
// 作  者:HZH
// 创建日期:2019-08-31 16:01:36
// 功能描述:UCDropDownBtn English:UCDropDownBtn
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// 项目地址:https://github.com/kwwwvagaa/NetWinformControl
// 如果你使用了此类,请保留以上说明
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-27-2019
//
// ***********************************************************************
// <copyright file="UCDropDownBtn.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;
......@@ -17,27 +24,56 @@ using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Drawing2D;
namespace HZH_Controls.Controls.Btn
namespace HZH_Controls.Controls
{
/// <summary>
/// Class UCDropDownBtn.
/// Implements the <see cref="HZH_Controls.Controls.UCBtnImg" />
/// </summary>
/// <seealso cref="HZH_Controls.Controls.UCBtnImg" />
[DefaultEvent("BtnClick")]
public partial class UCDropDownBtn : UCBtnImg
{
/// <summary>
/// The FRM anchor
/// </summary>
Forms.FrmAnchor _frmAnchor;
/// <summary>
/// The drop panel height
/// </summary>
private int _dropPanelHeight = -1;
/// <summary>
/// 按钮点击事件
/// </summary>
public new event EventHandler BtnClick;
/// <summary>
/// 下拉框高度
/// </summary>
/// <value>The height of the drop panel.</value>
[Description("下拉框高度"), Category("自定义")]
public int DropPanelHeight
{
get { return _dropPanelHeight; }
set { _dropPanelHeight = value; }
}
/// <summary>
/// The BTNS
/// </summary>
private string[] btns;
[Description("按钮"), Category("自定义")]
/// <summary>
/// 需要显示的按钮文字
/// </summary>
/// <value>The BTNS.</value>
[Description("需要显示的按钮文字"), Category("自定义")]
public string[] Btns
{
get { return btns; }
set { btns = value; }
}
/// <summary>
/// 图片
/// </summary>
/// <value>The image.</value>
[Obsolete("不再可用的属性")]
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override Image Image
......@@ -45,6 +81,10 @@ namespace HZH_Controls.Controls.Btn
get;
set;
}
/// <summary>
/// 图片位置
/// </summary>
/// <value>The image align.</value>
[Obsolete("不再可用的属性")]
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public override ContentAlignment ImageAlign
......@@ -52,7 +92,11 @@ namespace HZH_Controls.Controls.Btn
get;
set;
}
/// <summary>
/// 按钮字体颜色
/// </summary>
/// <value>The color of the BTN fore.</value>
[Description("按钮字体颜色"), Category("自定义")]
public override Color BtnForeColor
{
get
......@@ -79,6 +123,9 @@ namespace HZH_Controls.Controls.Btn
}
}
/// <summary>
/// Initializes a new instance of the <see cref="UCDropDownBtn" /> class.
/// </summary>
public UCDropDownBtn()
{
InitializeComponent();
......@@ -87,6 +134,11 @@ namespace HZH_Controls.Controls.Btn
base.BtnClick += UCDropDownBtn_BtnClick;
}
/// <summary>
/// Handles the BtnClick event of the UCDropDownBtn 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 UCDropDownBtn_BtnClick(object sender, EventArgs e)
{
if (_frmAnchor == null || _frmAnchor.IsDisposed || _frmAnchor.Visible == false)
......@@ -138,6 +190,11 @@ namespace HZH_Controls.Controls.Btn
_frmAnchor.Close();
}
}
/// <summary>
/// Handles the SelectSourceEvent event of the ucTime 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 ucTime_SelectSourceEvent(object sender, EventArgs e)
{
if (_frmAnchor != null && !_frmAnchor.IsDisposed && _frmAnchor.Visible)
......
namespace HZH_Controls.Controls
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-15-2019
//
// ***********************************************************************
// <copyright file="UCBtnsGroup.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 UCBtnsGroup.
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
partial class UCBtnsGroup
{
/// <summary>
......@@ -53,6 +73,9 @@
#endregion
/// <summary>
/// The flow layout panel1
/// </summary>
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
}
}
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:UCBtnsGroup.cs
// 创建日期:2019-08-15 15:58:13
// 功能描述:按钮组
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-15-2019
//
// ***********************************************************************
// <copyright file="UCBtnsGroup.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;
......@@ -14,16 +24,27 @@ using System.Windows.Forms;
namespace HZH_Controls.Controls
{
/// <summary>
/// Class UCBtnsGroup.
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
public partial class UCBtnsGroup : UserControl
{
/// <summary>
/// 选中改变事件
/// </summary>
[Description("选中改变事件"), Category("自定义")]
public event EventHandler SelectedItemChanged;
/// <summary>
/// The m data source
/// </summary>
private Dictionary<string, string> m_dataSource = new Dictionary<string, string>();
/// <summary>
/// 数据源
/// </summary>
/// <value>The data source.</value>
[Description("数据源"), Category("自定义")]
public Dictionary<string, string> DataSource
{
get { return m_dataSource; }
......@@ -34,10 +55,15 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// The m select item
/// </summary>
private List<string> m_selectItem = new List<string>();
/// <summary>
/// 选中项
/// </summary>
/// <value>The select item.</value>
[Description("选中项"), Category("自定义")]
public List<string> SelectItem
{
get { return m_selectItem; }
......@@ -50,20 +76,31 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// The m is multiple
/// </summary>
private bool m_isMultiple = false;
/// <summary>
/// 是否多选
/// </summary>
/// <value><c>true</c> if this instance is multiple; otherwise, <c>false</c>.</value>
[Description("是否多选"), Category("自定义")]
public bool IsMultiple
{
get { return m_isMultiple; }
set { m_isMultiple = value; }
}
/// <summary>
/// Initializes a new instance of the <see cref="UCBtnsGroup" /> class.
/// </summary>
public UCBtnsGroup()
{
InitializeComponent();
}
/// <summary>
/// Reloads this instance.
/// </summary>
private void Reload()
{
try
......@@ -106,6 +143,11 @@ namespace HZH_Controls.Controls
SetSelected();
}
/// <summary>
/// Handles the BtnClick event of the btn 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 btn_BtnClick(object sender, EventArgs e)
{
var btn = sender as UCBtnExt;
......@@ -136,6 +178,9 @@ namespace HZH_Controls.Controls
SelectedItemChanged(this, e);
}
/// <summary>
/// Sets the selected.
/// </summary>
private void SetSelected()
{
if (m_selectItem != null && m_selectItem.Count > 0 && DataSource != null && DataSource.Count > 0)
......
namespace HZH_Controls.Controls
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-08-2019
//
// ***********************************************************************
// <copyright file="UCCheckBox.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 UCCheckBox.
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
partial class UCCheckBox
{
/// <summary>
......@@ -73,7 +93,13 @@
#endregion
/// <summary>
/// The panel1
/// </summary>
private System.Windows.Forms.Panel panel1;
/// <summary>
/// The label1
/// </summary>
private System.Windows.Forms.Label label1;
}
}
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:UCCheckBox.cs
// 创建日期:2019-08-15 15:58:34
// 功能描述:CheckBox
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-08-2019
//
// ***********************************************************************
// <copyright file="UCCheckBox.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;
......@@ -14,12 +24,29 @@ using System.Windows.Forms;
namespace HZH_Controls.Controls
{
/// <summary>
/// Class UCCheckBox.
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
[DefaultEvent("CheckedChangeEvent")]
public partial class UCCheckBox : UserControl
{
/// <summary>
/// 选中改变事件
/// </summary>
[Description("选中改变事件"), Category("自定义")]
public event EventHandler CheckedChangeEvent;
/// <summary>
/// 字体
/// </summary>
/// <value>The font.</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>
[Description("字体"), Category("自定义")]
public override Font Font
{
......@@ -34,7 +61,17 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// The fore color
/// </summary>
private Color _ForeColor = Color.FromArgb(62, 62, 62);
/// <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 new Color ForeColor
{
......@@ -45,7 +82,14 @@ namespace HZH_Controls.Controls
_ForeColor = value;
}
}
/// <summary>
/// The text
/// </summary>
private string _Text = "复选框";
/// <summary>
/// 文本
/// </summary>
/// <value>The text value.</value>
[Description("文本"), Category("自定义")]
public string TextValue
{
......@@ -56,7 +100,14 @@ namespace HZH_Controls.Controls
_Text = value;
}
}
/// <summary>
/// The checked
/// </summary>
private bool _checked = false;
/// <summary>
/// 是否选中
/// </summary>
/// <value><c>true</c> if checked; otherwise, <c>false</c>.</value>
[Description("是否选中"), Category("自定义")]
public bool Checked
{
......@@ -100,6 +151,16 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// 获取或设置一个值,该值指示控件是否可以对用户交互作出响应。
/// </summary>
/// <value><c>true</c> if enabled; otherwise, <c>false</c>.</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 new bool Enabled
{
get
......@@ -133,11 +194,19 @@ namespace HZH_Controls.Controls
}
}
}
/// <summary>
/// Initializes a new instance of the <see cref="UCCheckBox" /> class.
/// </summary>
public UCCheckBox()
{
InitializeComponent();
}
/// <summary>
/// Handles the MouseDown event of the CheckBox control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
private void CheckBox_MouseDown(object sender, MouseEventArgs e)
{
Checked = !Checked;
......
namespace HZH_Controls.Controls
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-08-2019
//
// ***********************************************************************
// <copyright file="UCCombox.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 UCCombox.
/// Implements the <see cref="HZH_Controls.Controls.UCControlBase" />
/// </summary>
/// <seealso cref="HZH_Controls.Controls.UCControlBase" />
partial class UCCombox
{
/// <summary>
......@@ -110,8 +130,17 @@
#endregion
/// <summary>
/// The panel1
/// </summary>
private System.Windows.Forms.Panel panel1;
/// <summary>
/// The text input
/// </summary>
public TextBoxEx txtInput;
/// <summary>
/// The label input
/// </summary>
private System.Windows.Forms.Label lblInput;
}
}
namespace HZH_Controls.Controls.ComboBox
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-28-2019
//
// ***********************************************************************
// <copyright file="UCComboxGrid.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 UCComboxGrid.
/// Implements the <see cref="HZH_Controls.Controls.UCCombox" />
/// </summary>
/// <seealso cref="HZH_Controls.Controls.UCCombox" />
partial class UCComboxGrid
{
/// <summary>
......
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:uccomboxgrid.cs
// 作  者:HZH
// 创建日期:2019-08-31 16:01:55
// 功能描述:UCDropDownBtn English:UCDropDownBtn
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// 项目地址:https://github.com/kwwwvagaa/NetWinformControl
// 如果你使用了此类,请保留以上说明
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-28-2019
//
// ***********************************************************************
// <copyright file="UCComboxGrid.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;
......@@ -16,13 +23,24 @@ using System.Text;
using System.Windows.Forms;
using HZH_Controls.Controls;
namespace HZH_Controls.Controls.ComboBox
namespace HZH_Controls.Controls
{
/// <summary>
/// Class UCComboxGrid.
/// Implements the <see cref="HZH_Controls.Controls.UCCombox" />
/// </summary>
/// <seealso cref="HZH_Controls.Controls.UCCombox" />
public partial class UCComboxGrid : UCCombox
{
/// <summary>
/// The m row type
/// </summary>
private Type m_rowType = typeof(UCDataGridViewRow);
/// <summary>
/// 表格行类型
/// </summary>
/// <value>The type of the grid row.</value>
[Description("表格行类型"), Category("自定义")]
public Type GridRowType
{
......@@ -32,10 +50,19 @@ namespace HZH_Controls.Controls.ComboBox
m_rowType = value;
}
}
/// <summary>
/// The int width
/// </summary>
int intWidth = 0;
/// <summary>
/// The m columns
/// </summary>
private List<DataGridViewColumnEntity> m_columns = null;
/// <summary>
/// 表格列
/// </summary>
/// <value>The grid columns.</value>
[Description("表格列"), Category("自定义")]
public List<DataGridViewColumnEntity> GridColumns
{
......@@ -47,8 +74,14 @@ namespace HZH_Controls.Controls.ComboBox
intWidth = value.Sum(p => p.WidthType == SizeType.Absolute ? p.Width : (p.Width < 80 ? 80 : p.Width));
}
}
/// <summary>
/// The m data source
/// </summary>
private List<object> m_dataSource = null;
/// <summary>
/// 表格数据源
/// </summary>
/// <value>The grid data source.</value>
[Description("表格数据源"), Category("自定义")]
public List<object> GridDataSource
{
......@@ -56,8 +89,14 @@ namespace HZH_Controls.Controls.ComboBox
set { m_dataSource = value; }
}
/// <summary>
/// The m text field
/// </summary>
private string m_textField;
/// <summary>
/// 显示值字段名称
/// </summary>
/// <value>The text field.</value>
[Description("显示值字段名称"), Category("自定义")]
public string TextField
{
......@@ -68,6 +107,10 @@ namespace HZH_Controls.Controls.ComboBox
SetText();
}
}
/// <summary>
/// 控件样式
/// </summary>
/// <value>The box style.</value>
[Obsolete("不再可用的属性")]
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
private new ComboBoxStyle BoxStyle
......@@ -75,8 +118,14 @@ namespace HZH_Controls.Controls.ComboBox
get;
set;
}
/// <summary>
/// The select source
/// </summary>
private object selectSource = null;
/// <summary>
/// 选中的数据源
/// </summary>
/// <value>The select source.</value>
[Description("选中的数据源"), Category("自定义")]
public object SelectSource
{
......@@ -93,15 +142,31 @@ namespace HZH_Controls.Controls.ComboBox
}
/// <summary>
/// 选中数据源改变事件
/// </summary>
[Description("选中数据源改变事件"), Category("自定义")]
public new event EventHandler SelectedChangedEvent;
/// <summary>
/// Initializes a new instance of the <see cref="UCComboxGrid" /> class.
/// </summary>
public UCComboxGrid()
{
InitializeComponent();
}
/// <summary>
/// The m uc panel
/// </summary>
UCComboxGridPanel m_ucPanel = null;
/// <summary>
/// The FRM anchor
/// </summary>
Forms.FrmAnchor _frmAnchor;
/// <summary>
/// Handles the MouseDown event of the click control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
protected override void click_MouseDown(object sender, MouseEventArgs e)
{
if (m_columns == null || m_columns.Count <= 0)
......@@ -135,12 +200,20 @@ namespace HZH_Controls.Controls.ComboBox
}
/// <summary>
/// Handles the ItemClick event of the m_ucPanel control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="DataGridViewEventArgs" /> instance containing the event data.</param>
void m_ucPanel_ItemClick(object sender, DataGridViewEventArgs e)
{
_frmAnchor.Hide();
SelectSource = sender;
}
/// <summary>
/// Sets the text.
/// </summary>
private void SetText()
{
if (!string.IsNullOrEmpty(m_textField) && selectSource != null)
......
namespace HZH_Controls.Controls.ComboBox
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-28-2019
//
// ***********************************************************************
// <copyright file="UCComboxGridPanel.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 UCComboxGridPanel.
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
partial class UCComboxGridPanel
{
/// <summary>
......@@ -210,15 +230,45 @@
#endregion
/// <summary>
/// The uc split line h1
/// </summary>
private UCSplitLine_H ucSplitLine_H1;
/// <summary>
/// The uc split line h2
/// </summary>
private UCSplitLine_H ucSplitLine_H2;
/// <summary>
/// The uc split line v1
/// </summary>
private UCSplitLine_V ucSplitLine_V1;
/// <summary>
/// The uc split line v2
/// </summary>
private UCSplitLine_V ucSplitLine_V2;
/// <summary>
/// The panel1
/// </summary>
private System.Windows.Forms.Panel panel1;
/// <summary>
/// The uc control base1
/// </summary>
private UCControlBase ucControlBase1;
/// <summary>
/// The uc data grid view1
/// </summary>
private UCDataGridView ucDataGridView1;
/// <summary>
/// The panel2
/// </summary>
private System.Windows.Forms.Panel panel2;
/// <summary>
/// The timer1
/// </summary>
private System.Windows.Forms.Timer timer1;
/// <summary>
/// The text search
/// </summary>
private UCTextBoxEx txtSearch;
}
}
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:UCComboxGridPanel.cs
// 作  者:HZH
// 创建日期:2019-08-31 16:02:08
// 功能描述:UCComboxGridPanel English:UCComboxGridPanel
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// 项目地址:https://github.com/kwwwvagaa/NetWinformControl
// 如果你使用了此类,请保留以上说明
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-28-2019
//
// ***********************************************************************
// <copyright file="UCComboxGridPanel.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;
......@@ -15,15 +22,30 @@ using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls.ComboBox
namespace HZH_Controls.Controls
{
/// <summary>
/// Class UCComboxGridPanel.
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
[ToolboxItem(false)]
public partial class UCComboxGridPanel : UserControl
{
/// <summary>
/// 项点击事件
/// </summary>
[Description("项点击事件"), Category("自定义")]
public event DataGridViewEventHandler ItemClick;
/// <summary>
/// The m row type
/// </summary>
private Type m_rowType = typeof(UCDataGridViewRow);
/// <summary>
/// 行类型
/// </summary>
/// <value>The type of the row.</value>
[Description("行类型"), Category("自定义")]
public Type RowType
{
get { return m_rowType; }
......@@ -34,8 +56,15 @@ namespace HZH_Controls.Controls.ComboBox
}
}
/// <summary>
/// The m columns
/// </summary>
private List<DataGridViewColumnEntity> m_columns = null;
/// <summary>
/// 列
/// </summary>
/// <value>The columns.</value>
[Description("列"), Category("自定义")]
public List<DataGridViewColumnEntity> Columns
{
get { return m_columns; }
......@@ -45,17 +74,33 @@ namespace HZH_Controls.Controls.ComboBox
this.ucDataGridView1.Columns = value;
}
}
/// <summary>
/// The m data source
/// </summary>
private List<object> m_dataSource = null;
/// <summary>
/// 数据源
/// </summary>
/// <value>The data source.</value>
[Description("数据源"), Category("自定义")]
public List<object> DataSource
{
get { return m_dataSource; }
set { m_dataSource = value; }
}
/// <summary>
/// The string last search text
/// </summary>
private string strLastSearchText = string.Empty;
/// <summary>
/// The m page
/// </summary>
UCPagerControl m_page = new UCPagerControl();
/// <summary>
/// Initializes a new instance of the <see cref="UCComboxGridPanel" /> class.
/// </summary>
public UCComboxGridPanel()
{
InitializeComponent();
......@@ -65,6 +110,11 @@ namespace HZH_Controls.Controls.ComboBox
this.ucDataGridView1.ItemClick += ucDataGridView1_ItemClick;
}
/// <summary>
/// Handles the ItemClick event of the ucDataGridView1 control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="DataGridViewEventArgs" /> instance containing the event data.</param>
void ucDataGridView1_ItemClick(object sender, DataGridViewEventArgs e)
{
if (ItemClick != null)
......@@ -73,18 +123,33 @@ namespace HZH_Controls.Controls.ComboBox
}
}
/// <summary>
/// Handles the TextChanged event of the txtInput 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 txtInput_TextChanged(object sender, EventArgs e)
{
timer1.Enabled = false;
timer1.Enabled = true;
}
/// <summary>
/// Handles the Load event of the UCComboxGridPanel control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
private void UCComboxGridPanel_Load(object sender, EventArgs e)
{
m_page.DataSource = m_dataSource;
this.ucDataGridView1.DataSource = m_page.GetCurrentSource();
}
/// <summary>
/// Handles the Tick event of the timer1 control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
private void timer1_Tick(object sender, EventArgs e)
{
if (strLastSearchText == txtSearch.InputText)
......@@ -98,6 +163,10 @@ namespace HZH_Controls.Controls.ComboBox
}
}
/// <summary>
/// Searches the specified string text.
/// </summary>
/// <param name="strText">The string text.</param>
private void Search(string strText)
{
m_page.StartIndex = 0;
......
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:DataGridViewCellEntity.cs
// 创建日期:2019-08-15 15:59:03
// 功能描述:DataGridView
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-09-2019
//
// ***********************************************************************
// <copyright file="DataGridViewCellEntity.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;
......@@ -10,10 +20,25 @@ using System.Text;
namespace HZH_Controls.Controls
{
/// <summary>
/// Class DataGridViewCellEntity.
/// </summary>
public class DataGridViewCellEntity
{
/// <summary>
/// Gets or sets the title.
/// </summary>
/// <value>The title.</value>
public string Title { get; set; }
/// <summary>
/// Gets or sets the width.
/// </summary>
/// <value>The width.</value>
public int Width { get; set; }
/// <summary>
/// Gets or sets the type of the width.
/// </summary>
/// <value>The type of the width.</value>
public System.Windows.Forms.SizeType WidthType { get; set; }
}
......
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:DataGridViewCellEventArgs.cs
// 创建日期:2019-08-15 15:59:10
// 功能描述:DataGridView
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-09-2019
//
// ***********************************************************************
// <copyright file="DataGridViewCellEventArgs.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;
......@@ -11,10 +21,27 @@ using System.Windows.Forms;
namespace HZH_Controls.Controls
{
/// <summary>
/// Class DataGridViewEventArgs.
/// Implements the <see cref="System.EventArgs" />
/// </summary>
/// <seealso cref="System.EventArgs" />
public class DataGridViewEventArgs : EventArgs
{
/// <summary>
/// Gets or sets the cell control.
/// </summary>
/// <value>The cell control.</value>
public Control CellControl { get; set; }
/// <summary>
/// Gets or sets the index of the cell.
/// </summary>
/// <value>The index of the cell.</value>
public int CellIndex { get; set; }
/// <summary>
/// Gets or sets the index of the row.
/// </summary>
/// <value>The index of the row.</value>
public int RowIndex { get; set; }
}
......
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:DataGridViewCellEventHandler.cs
// 创建日期:2019-08-15 15:59:13
// 功能描述:DataGridView
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-09-2019
//
// ***********************************************************************
// <copyright file="DataGridViewCellEventHandler.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;
......@@ -11,10 +21,20 @@ using System.Text;
namespace HZH_Controls.Controls
{
/// <summary>
/// Delegate DataGridViewEventHandler
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The <see cref="DataGridViewEventArgs" /> instance containing the event data.</param>
[Serializable]
[ComVisible(true)]
public delegate void DataGridViewEventHandler(object sender, DataGridViewEventArgs e);
/// <summary>
/// Delegate DataGridViewRowCustomEventHandler
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The <see cref="DataGridViewRowCustomEventArgs" /> instance containing the event data.</param>
[Serializable]
[ComVisible(true)]
public delegate void DataGridViewRowCustomEventHandler(object sender, DataGridViewRowCustomEventArgs e);
......
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:DataGridViewColumnEntity.cs
// 创建日期:2019-08-15 15:59:17
// 功能描述:DataGridView
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-09-2019
//
// ***********************************************************************
// <copyright file="DataGridViewColumnEntity.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;
......@@ -11,14 +21,44 @@ using System.Drawing;
namespace HZH_Controls.Controls
{
/// <summary>
/// Class DataGridViewColumnEntity.
/// </summary>
public class DataGridViewColumnEntity
{
/// <summary>
/// Gets or sets the head text.
/// </summary>
/// <value>The head text.</value>
public string HeadText { get; set; }
/// <summary>
/// Gets or sets the width.
/// </summary>
/// <value>The width.</value>
public int Width { get; set; }
/// <summary>
/// Gets or sets the type of the width.
/// </summary>
/// <value>The type of the width.</value>
public System.Windows.Forms.SizeType WidthType { get; set; }
/// <summary>
/// Gets or sets the data field.
/// </summary>
/// <value>The data field.</value>
public string DataField { get; set; }
/// <summary>
/// Gets or sets the format.
/// </summary>
/// <value>The format.</value>
public Func<object, string> Format { get; set; }
/// <summary>
/// The text align
/// </summary>
private ContentAlignment _TextAlign = ContentAlignment.MiddleCenter;
/// <summary>
/// Gets or sets the text align.
/// </summary>
/// <value>The text align.</value>
public ContentAlignment TextAlign { get { return _TextAlign; } set { _TextAlign = value; } }
}
}
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:DataGridViewRowCustomEventArgs.cs
// 作  者:HZH
// 创建日期:2019-08-31 16:02:31
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// 项目地址:https://github.com/kwwwvagaa/NetWinformControl
// 如果你使用了此类,请保留以上说明
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-27-2019
//
// ***********************************************************************
// <copyright file="DataGridViewRowCustomEventArgs.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;
......@@ -12,8 +20,17 @@ using System.Text;
namespace HZH_Controls.Controls
{
/// <summary>
/// Class DataGridViewRowCustomEventArgs.
/// Implements the <see cref="System.EventArgs" />
/// </summary>
/// <seealso cref="System.EventArgs" />
public class DataGridViewRowCustomEventArgs : EventArgs
{
/// <summary>
/// Gets or sets the name of the event.
/// </summary>
/// <value>The name of the event.</value>
public string EventName { get; set; }
}
}
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:IDataGridViewRow.cs
// 创建日期:2019-08-15 15:59:21
// 功能描述:DataGridView
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-09-2019
//
// ***********************************************************************
// <copyright file="IDataGridViewRow.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;
......@@ -11,8 +21,14 @@ using System.Windows.Forms;
namespace HZH_Controls.Controls
{
/// <summary>
/// Interface IDataGridViewRow
/// </summary>
public interface IDataGridViewRow
{
/// <summary>
/// Occurs when [row custom event].
/// </summary>
event DataGridViewRowCustomEventHandler RowCustomEvent;
/// <summary>
/// CheckBox选中事件
......@@ -29,16 +45,23 @@ namespace HZH_Controls.Controls
/// <summary>
/// 列参数,用于创建列数和宽度
/// </summary>
/// <value>The columns.</value>
List<DataGridViewColumnEntity> Columns { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is show CheckBox.
/// </summary>
/// <value><c>true</c> if this instance is show CheckBox; otherwise, <c>false</c>.</value>
bool IsShowCheckBox { get; set; }
/// <summary>
/// 是否选中
/// </summary>
/// <value><c>true</c> if this instance is checked; otherwise, <c>false</c>.</value>
bool IsChecked { get; set; }
/// <summary>
/// 数据源
/// </summary>
/// <value>The data source.</value>
object DataSource { get; set; }
/// <summary>
/// 添加单元格元素,仅做添加控件操作,不做数据绑定,数据绑定使用BindingCells
......@@ -47,7 +70,6 @@ namespace HZH_Controls.Controls
/// <summary>
/// 绑定数据到Cell
/// </summary>
/// <param name="intIndex">cell下标</param>
/// <returns>返回true则表示已处理过,否则将进行默认绑定(通常只针对有Text值的控件)</returns>
void BindingCellData();
/// <summary>
......@@ -58,6 +80,7 @@ namespace HZH_Controls.Controls
/// <summary>
/// 行高
/// </summary>
/// <value>The height of the row.</value>
int RowHeight { get; set; }
}
}
namespace HZH_Controls.Controls
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-09-2019
//
// ***********************************************************************
// <copyright file="UCDataGridView.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 UCDataGridView.
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
partial class UCDataGridView
{
/// <summary>
......@@ -114,11 +134,29 @@
#endregion
/// <summary>
/// The pan head
/// </summary>
private System.Windows.Forms.Panel panHead;
/// <summary>
/// The pan columns
/// </summary>
private System.Windows.Forms.TableLayoutPanel panColumns;
/// <summary>
/// The uc split line h1
/// </summary>
private UCSplitLine_H ucSplitLine_H1;
/// <summary>
/// The pan row
/// </summary>
private System.Windows.Forms.Panel panRow;
/// <summary>
/// The pan page
/// </summary>
private System.Windows.Forms.Panel panPage;
/// <summary>
/// The pan head left
/// </summary>
private System.Windows.Forms.Panel panHeadLeft;
}
......
namespace HZH_Controls.Controls
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-09-2019
//
// ***********************************************************************
// <copyright file="UCDataGridViewRow.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 UCDataGridViewRow.
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
partial class UCDataGridViewRow
{
/// <summary>
......@@ -70,7 +90,13 @@
#endregion
/// <summary>
/// The uc split line h1
/// </summary>
private UCSplitLine_H ucSplitLine_H1;
/// <summary>
/// The pan cells
/// </summary>
private System.Windows.Forms.TableLayoutPanel panCells;
}
}
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:UCDataGridViewRow.cs
// 创建日期:2019-08-15 15:59:31
// 功能描述:DataGridView
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-09-2019
//
// ***********************************************************************
// <copyright file="UCDataGridViewRow.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;
......@@ -14,35 +24,73 @@ using System.Windows.Forms;
namespace HZH_Controls.Controls
{
/// <summary>
/// Class UCDataGridViewRow.
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// Implements the <see cref="HZH_Controls.Controls.IDataGridViewRow" />
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
/// <seealso cref="HZH_Controls.Controls.IDataGridViewRow" />
[ToolboxItem(false)]
public partial class UCDataGridViewRow : UserControl, IDataGridViewRow
{
#region 属性
/// <summary>
/// CheckBox选中事件
/// </summary>
public event DataGridViewEventHandler CheckBoxChangeEvent;
/// <summary>
/// Occurs when [row custom event].
/// </summary>
public event DataGridViewRowCustomEventHandler RowCustomEvent;
/// <summary>
/// 点击单元格事件
/// </summary>
public event DataGridViewEventHandler CellClick;
/// <summary>
/// 数据源改变事件
/// </summary>
public event DataGridViewEventHandler SourceChanged;
/// <summary>
/// 列参数,用于创建列数和宽度
/// </summary>
/// <value>The columns.</value>
public List<DataGridViewColumnEntity> Columns
{
get;
set;
}
/// <summary>
/// 数据源
/// </summary>
/// <value>The data source.</value>
public object DataSource
{
get;
set;
}
/// <summary>
/// Gets or sets a value indicating whether this instance is show CheckBox.
/// </summary>
/// <value><c>true</c> if this instance is show CheckBox; otherwise, <c>false</c>.</value>
public bool IsShowCheckBox
{
get;
set;
}
/// <summary>
/// The m is checked
/// </summary>
private bool m_isChecked;
/// <summary>
/// 是否选中
/// </summary>
/// <value><c>true</c> if this instance is checked; otherwise, <c>false</c>.</value>
public bool IsChecked
{
get
......@@ -59,7 +107,14 @@ namespace HZH_Controls.Controls
}
}
}
/// <summary>
/// The m row height
/// </summary>
int m_rowHeight = 40;
/// <summary>
/// 行高
/// </summary>
/// <value>The height of the row.</value>
public int RowHeight
{
get
......@@ -75,11 +130,18 @@ namespace HZH_Controls.Controls
#endregion
/// <summary>
/// Initializes a new instance of the <see cref="UCDataGridViewRow" /> class.
/// </summary>
public UCDataGridViewRow()
{
InitializeComponent();
}
/// <summary>
/// 绑定数据到Cell
/// </summary>
/// <returns>返回true则表示已处理过,否则将进行默认绑定(通常只针对有Text值的控件)</returns>
public void BindingCellData()
{
for (int i = 0; i < Columns.Count; i++)
......@@ -105,6 +167,11 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// Handles the MouseDown event of the Item control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
void Item_MouseDown(object sender, MouseEventArgs e)
{
if (CellClick != null)
......@@ -117,6 +184,10 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// 设置选中状态,通常为设置颜色即可
/// </summary>
/// <param name="blnSelected">是否选中</param>
public void SetSelect(bool blnSelected)
{
if (blnSelected)
......@@ -129,6 +200,9 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// Reloads the cells.
/// </summary>
public void ReloadCells()
{
try
......
namespace HZH_Controls.Controls
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-23-2019
//
// ***********************************************************************
// <copyright file="UCDataGridViewTreeRow.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 UCDataGridViewTreeRow.
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
partial class UCDataGridViewTreeRow
{
/// <summary>
......@@ -155,13 +175,37 @@
#endregion
/// <summary>
/// The pan cells
/// </summary>
private System.Windows.Forms.TableLayoutPanel panCells;
/// <summary>
/// The uc split line h1
/// </summary>
private UCSplitLine_H ucSplitLine_H1;
/// <summary>
/// The pan left
/// </summary>
private System.Windows.Forms.Panel panLeft;
/// <summary>
/// The pan child grid
/// </summary>
private System.Windows.Forms.Panel panChildGrid;
/// <summary>
/// The uc DGV child
/// </summary>
private UCDataGridView ucDGVChild;
/// <summary>
/// The pan child left
/// </summary>
private System.Windows.Forms.Panel panChildLeft;
/// <summary>
/// The pan main
/// </summary>
private System.Windows.Forms.Panel panMain;
/// <summary>
/// The uc split line v1
/// </summary>
private UCSplitLine_V ucSplitLine_V1;
}
}
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:UCDataGridViewTreeRow.cs
// 作  者:HZH
// 创建日期:2019-08-31 16:02:55
// 功能描述:UCDataGridViewTreeRow English:UCDataGridViewTreeRow
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// 项目地址:https://github.com/kwwwvagaa/NetWinformControl
// 如果你使用了此类,请保留以上说明
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-23-2019
//
// ***********************************************************************
// <copyright file="UCDataGridViewTreeRow.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;
......@@ -18,34 +25,72 @@ using System.Collections;
namespace HZH_Controls.Controls
{
/// <summary>
/// Class UCDataGridViewTreeRow.
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// Implements the <see cref="HZH_Controls.Controls.IDataGridViewRow" />
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
/// <seealso cref="HZH_Controls.Controls.IDataGridViewRow" />
[ToolboxItem(false)]
public partial class UCDataGridViewTreeRow : UserControl, IDataGridViewRow
{
#region 属性
/// <summary>
/// CheckBox选中事件
/// </summary>
public event DataGridViewEventHandler CheckBoxChangeEvent;
/// <summary>
/// 点击单元格事件
/// </summary>
public event DataGridViewEventHandler CellClick;
/// <summary>
/// 数据源改变事件
/// </summary>
public event DataGridViewEventHandler SourceChanged;
/// <summary>
/// Occurs when [row custom event].
/// </summary>
public event DataGridViewRowCustomEventHandler RowCustomEvent;
/// <summary>
/// 列参数,用于创建列数和宽度
/// </summary>
/// <value>The columns.</value>
public List<DataGridViewColumnEntity> Columns
{
get;
set;
}
/// <summary>
/// 数据源
/// </summary>
/// <value>The data source.</value>
public object DataSource
{
get;
set;
}
/// <summary>
/// Gets or sets a value indicating whether this instance is show CheckBox.
/// </summary>
/// <value><c>true</c> if this instance is show CheckBox; otherwise, <c>false</c>.</value>
public bool IsShowCheckBox
{
get;
set;
}
/// <summary>
/// The m is checked
/// </summary>
private bool m_isChecked;
/// <summary>
/// 是否选中
/// </summary>
/// <value><c>true</c> if this instance is checked; otherwise, <c>false</c>.</value>
public bool IsChecked
{
get
......@@ -63,7 +108,14 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// The m row height
/// </summary>
int m_rowHeight = 40;
/// <summary>
/// 行高
/// </summary>
/// <value>The height of the row.</value>
public int RowHeight
{
get
......@@ -78,6 +130,9 @@ namespace HZH_Controls.Controls
}
#endregion
/// <summary>
/// Initializes a new instance of the <see cref="UCDataGridViewTreeRow" /> class.
/// </summary>
public UCDataGridViewTreeRow()
{
InitializeComponent();
......@@ -98,6 +153,11 @@ namespace HZH_Controls.Controls
}
/// <summary>
/// Handles the SizeChanged event of the UCDataGridViewTreeRow 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 UCDataGridViewTreeRow_SizeChanged(object sender, EventArgs e)
{
if (this.Parent.Parent.Parent != null && this.Parent.Parent.Parent.Name == "panChildGrid" && this.panLeft.Tag.ToInt() == 1)
......@@ -109,6 +169,10 @@ namespace HZH_Controls.Controls
}
/// <summary>
/// 绑定数据到Cell
/// </summary>
/// <returns>返回true则表示已处理过,否则将进行默认绑定(通常只针对有Text值的控件)</returns>
public void BindingCellData()
{
for (int i = 0; i < Columns.Count; i++)
......@@ -176,6 +240,11 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// Handles the MouseDown event of the Item control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
void Item_MouseDown(object sender, MouseEventArgs e)
{
if (CellClick != null)
......@@ -188,6 +257,10 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// 设置选中状态,通常为设置颜色即可
/// </summary>
/// <param name="blnSelected">是否选中</param>
public void SetSelect(bool blnSelected)
{
if (blnSelected)
......@@ -200,6 +273,9 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// 添加单元格元素,仅做添加控件操作,不做数据绑定,数据绑定使用BindingCells
/// </summary>
public void ReloadCells()
{
try
......@@ -273,6 +349,11 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// Handles the SizeChanged event of the panChildGrid control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
private void panChildGrid_SizeChanged(object sender, EventArgs e)
{
int intHeight = RowHeight + panChildGrid.Height;
......@@ -282,6 +363,11 @@ namespace HZH_Controls.Controls
this.Height = intHeight;
}
/// <summary>
/// Handles the MouseDown event of the panLeft control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
private void panLeft_MouseDown(object sender, MouseEventArgs e)
{
try
......@@ -332,6 +418,11 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// Handles the SizeChanged event of the ucDGVChild control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
private void ucDGVChild_SizeChanged(object sender, EventArgs e)
{
......
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:DateTimePickerType.cs
// 创建日期:2019-08-15 15:59:40
// 功能描述:DateTime
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-08-2019
//
// ***********************************************************************
// <copyright file="DateTimePickerType.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;
......@@ -10,10 +20,22 @@ using System.Text;
namespace HZH_Controls.Controls
{
/// <summary>
/// Enum DateTimePickerType
/// </summary>
public enum DateTimePickerType
{
/// <summary>
/// The date time
/// </summary>
DateTime = 1,
/// <summary>
/// The date
/// </summary>
Date = 2,
/// <summary>
/// The time
/// </summary>
Time = 4
}
}
namespace HZH_Controls.Controls
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-08-2019
//
// ***********************************************************************
// <copyright file="UCDatePickerExt.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 UCDatePickerExt.
/// Implements the <see cref="HZH_Controls.Controls.UCControlBase" />
/// </summary>
/// <seealso cref="HZH_Controls.Controls.UCControlBase" />
partial class UCDatePickerExt
{
/// <summary>
......@@ -316,16 +336,49 @@
#endregion
/// <summary>
/// The panel1
/// </summary>
private System.Windows.Forms.Panel panel1;
/// <summary>
/// The label4
/// </summary>
private System.Windows.Forms.Label label4;
/// <summary>
/// The label3
/// </summary>
private System.Windows.Forms.Label label3;
/// <summary>
/// The label2
/// </summary>
private System.Windows.Forms.Label label2;
/// <summary>
/// The label1
/// </summary>
private System.Windows.Forms.Label label1;
/// <summary>
/// The text minute
/// </summary>
private TextBoxEx txtMinute;
/// <summary>
/// The text hour
/// </summary>
private TextBoxEx txtHour;
/// <summary>
/// The text day
/// </summary>
private TextBoxEx txtDay;
/// <summary>
/// The text month
/// </summary>
private TextBoxEx txtMonth;
/// <summary>
/// The text year
/// </summary>
private TextBoxEx txtYear;
/// <summary>
/// The label5
/// </summary>
private System.Windows.Forms.Label label5;
}
}
namespace HZH_Controls.Controls
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-08-2019
//
// ***********************************************************************
// <copyright file="UCDateTimeSelectPan.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 UCDateTimeSelectPan.
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
public partial class UCDateTimeSelectPan
{
/// <summary>
......@@ -399,25 +419,85 @@
#endregion
/// <summary>
/// The panel1
/// </summary>
private System.Windows.Forms.Panel panel1;
/// <summary>
/// The uc split line h1
/// </summary>
private UCSplitLine_H ucSplitLine_H1;
/// <summary>
/// The panel2
/// </summary>
private System.Windows.Forms.Panel panel2;
/// <summary>
/// The uc split line h2
/// </summary>
private UCSplitLine_H ucSplitLine_H2;
/// <summary>
/// The pan mian
/// </summary>
private System.Windows.Forms.Panel panMian;
/// <summary>
/// The BTN minute
/// </summary>
private UCBtnExt btnMinute;
/// <summary>
/// The BTN day
/// </summary>
private UCBtnExt btnDay;
/// <summary>
/// The BTN hour
/// </summary>
private UCBtnExt btnHour;
/// <summary>
/// The BTN month
/// </summary>
private UCBtnExt btnMonth;
/// <summary>
/// The BTN year
/// </summary>
private UCBtnExt btnYear;
/// <summary>
/// The pan time
/// </summary>
private UCTimePanel panTime;
/// <summary>
/// The BTN cancel
/// </summary>
private UCBtnExt btnCancel;
/// <summary>
/// The BTN ok
/// </summary>
private UCBtnExt btnOk;
/// <summary>
/// The pan right
/// </summary>
private System.Windows.Forms.Panel panRight;
/// <summary>
/// The pan left
/// </summary>
private System.Windows.Forms.Panel panLeft;
/// <summary>
/// The SP4
/// </summary>
private System.Windows.Forms.Panel sp4;
/// <summary>
/// The SP3
/// </summary>
private System.Windows.Forms.Panel sp3;
/// <summary>
/// The SP2
/// </summary>
private System.Windows.Forms.Panel sp2;
/// <summary>
/// The SP1
/// </summary>
private System.Windows.Forms.Panel sp1;
/// <summary>
/// The panel3
/// </summary>
private System.Windows.Forms.Panel panel3;
}
......
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:UCDateTimeSelectPan.cs
// 创建日期:2019-08-15 15:59:51
// 功能描述:DateTime
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-08-2019
//
// ***********************************************************************
// <copyright file="UCDateTimeSelectPan.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;
......@@ -15,14 +25,32 @@ using System.Windows.Forms;
namespace HZH_Controls.Controls
{
/// <summary>
/// Class UCDateTimeSelectPan.
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
[ToolboxItem(false)]
public partial class UCDateTimeSelectPan : UserControl
{
/// <summary>
/// Occurs when [selected time event].
/// </summary>
[Description("确定事件"), Category("自定义")]
public event EventHandler SelectedTimeEvent;
/// <summary>
/// Occurs when [cancel time event].
/// </summary>
[Description("取消事件"), Category("自定义")]
public event EventHandler CancelTimeEvent;
/// <summary>
/// The automatic select next
/// </summary>
private bool autoSelectNext = true;
/// <summary>
/// Gets or sets a value indicating whether [automatic select next].
/// </summary>
/// <value><c>true</c> if [automatic select next]; otherwise, <c>false</c>.</value>
[Description("自动选中下一级"), Category("自定义")]
public bool AutoSelectNext
{
......@@ -30,8 +58,15 @@ namespace HZH_Controls.Controls
set { autoSelectNext = value; }
}
/// <summary>
/// The m dt
/// </summary>
DateTime m_dt = DateTime.Now;
/// <summary>
/// Gets or sets the current time.
/// </summary>
/// <value>The current time.</value>
public DateTime CurrentTime
{
get { return m_dt; }
......@@ -41,21 +76,38 @@ namespace HZH_Controls.Controls
SetTimeToControl();
}
}
/// <summary>
/// The m this BTN
/// </summary>
UCBtnExt m_thisBtn = null;
/// <summary>
/// The m type
/// </summary>
DateTimePickerType m_type = DateTimePickerType.DateTime;
/// <summary>
/// Gets or sets the type of the time.
/// </summary>
/// <value>The type of the time.</value>
[Description("时间类型"), Category("自定义")]
public DateTimePickerType TimeType
{
get { return m_type; }
set { m_type = value; }
}
/// <summary>
/// Initializes a new instance of the <see cref="UCDateTimeSelectPan" /> class.
/// </summary>
public UCDateTimeSelectPan()
{
InitializeComponent();
panTime.SelectSourceEvent += panTime_SelectSourceEvent;
this.TabStop = false;
}
/// <summary>
/// Initializes a new instance of the <see cref="UCDateTimeSelectPan" /> class.
/// </summary>
/// <param name="dt">The dt.</param>
public UCDateTimeSelectPan(DateTime dt)
{
m_dt = dt;
......@@ -64,6 +116,11 @@ namespace HZH_Controls.Controls
this.TabStop = false;
}
/// <summary>
/// Handles the SelectSourceEvent event of the panTime 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 panTime_SelectSourceEvent(object sender, EventArgs e)
{
string strKey = sender.ToString();
......@@ -113,6 +170,11 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// Handles the Load event of the UCDateTimePickerExt control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
private void UCDateTimePickerExt_Load(object sender, EventArgs e)
{
SetTimeToControl();
......@@ -141,6 +203,9 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// Sets the time to control.
/// </summary>
private void SetTimeToControl()
{
btnYear.Tag = m_dt.Year;
......@@ -155,6 +220,10 @@ namespace HZH_Controls.Controls
btnMinute.BtnText = m_dt.Minute.ToString().PadLeft(2, '0') + "分";
}
/// <summary>
/// Sets the type of the select.
/// </summary>
/// <param name="btn">The BTN.</param>
private void SetSelectType(UCBtnExt btn)
{
try
......@@ -250,11 +319,21 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// Handles the BtnClick event of the btnTime control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
private void btnTime_BtnClick(object sender, EventArgs e)
{
SetSelectType((UCBtnExt)sender);
}
/// <summary>
/// Handles the MouseDown event of the panLeft control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
private void panLeft_MouseDown(object sender, MouseEventArgs e)
{
List<KeyValuePair<string, string>> lstSource = new List<KeyValuePair<string, string>>();
......@@ -271,6 +350,11 @@ namespace HZH_Controls.Controls
panTime.ResumeLayout(true);
}
/// <summary>
/// Handles the MouseDown event of the panRight control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
private void panRight_MouseDown(object sender, MouseEventArgs e)
{
List<KeyValuePair<string, string>> lstSource = new List<KeyValuePair<string, string>>();
......@@ -287,12 +371,22 @@ namespace HZH_Controls.Controls
panTime.ResumeLayout(true);
}
/// <summary>
/// Handles the BtnClick event of the btnOk control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
private void btnOk_BtnClick(object sender, EventArgs e)
{
if (SelectedTimeEvent != null)
SelectedTimeEvent(m_dt, null);
}
/// <summary>
/// Handles the BtnClick event of the btnCancel control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
private void btnCancel_BtnClick(object sender, EventArgs e)
{
if (CancelTimeEvent != null)
......
namespace HZH_Controls.Controls
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-08-2019
//
// ***********************************************************************
// <copyright file="UCTimePanel.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 UCTimePanel.
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
partial class UCTimePanel
{
/// <summary>
......@@ -110,10 +130,25 @@
#endregion
/// <summary>
/// The pan main
/// </summary>
private System.Windows.Forms.TableLayoutPanel panMain;
/// <summary>
/// The uc split line v1
/// </summary>
private UCSplitLine_V ucSplitLine_V1;
/// <summary>
/// The uc split line v2
/// </summary>
private UCSplitLine_V ucSplitLine_V2;
/// <summary>
/// The uc split line h1
/// </summary>
private UCSplitLine_H ucSplitLine_H1;
/// <summary>
/// The uc split line h2
/// </summary>
private UCSplitLine_H ucSplitLine_H2;
}
}
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:UCTimePanel.cs
// 创建日期:2019-08-15 15:59:56
// 功能描述:DateTime
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-08-2019
//
// ***********************************************************************
// <copyright file="UCTimePanel.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;
......@@ -15,13 +25,32 @@ using System.Windows.Forms;
namespace HZH_Controls.Controls
{
/// <summary>
/// Class UCTimePanel.
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
[ToolboxItem(false)]
public partial class UCTimePanel : UserControl
{
/// <summary>
/// Occurs when [select source event].
/// </summary>
public event EventHandler SelectSourceEvent;
/// <summary>
/// The source
/// </summary>
private List<KeyValuePair<string, string>> source = null;
/// <summary>
/// Gets or sets a value indicating whether [first event].
/// </summary>
/// <value><c>true</c> if [first event]; otherwise, <c>false</c>.</value>
public bool FirstEvent { get; set; }
/// <summary>
/// Gets or sets the source.
/// </summary>
/// <value>The source.</value>
public List<KeyValuePair<string, string>> Source
{
get { return source; }
......@@ -32,8 +61,15 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// The is show border
/// </summary>
private bool _IsShowBorder = false;
/// <summary>
/// Gets or sets a value indicating whether this instance is show border.
/// </summary>
/// <value><c>true</c> if this instance is show border; otherwise, <c>false</c>.</value>
public bool IsShowBorder
{
get { return _IsShowBorder; }
......@@ -47,10 +83,14 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// The select BTN
/// </summary>
UCBtnExt selectBtn;
/// <summary>
/// 选中按钮
/// </summary>
/// <value>The select BTN.</value>
public UCBtnExt SelectBtn
{
get { return selectBtn; }
......@@ -74,19 +114,34 @@ namespace HZH_Controls.Controls
}
}
}
/// <summary>
/// Initializes a new instance of the <see cref="UCTimePanel" /> class.
/// </summary>
public UCTimePanel()
{
InitializeComponent();
this.SizeChanged += UCTimePanel_SizeChanged;
}
/// <summary>
/// Handles the SizeChanged event of the UCTimePanel 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 UCTimePanel_SizeChanged(object sender, EventArgs e)
{
}
/// <summary>
/// The row
/// </summary>
private int row = 0;
/// <summary>
/// Gets or sets the row.
/// </summary>
/// <value>The row.</value>
public int Row
{
get { return row; }
......@@ -98,8 +153,15 @@ namespace HZH_Controls.Controls
}
/// <summary>
/// The column
/// </summary>
private int column = 0;
/// <summary>
/// Gets or sets the column.
/// </summary>
/// <value>The column.</value>
public int Column
{
get { return column; }
......@@ -110,6 +172,11 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// Handles the Load event of the UCTimePanel control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
private void UCTimePanel_Load(object sender, EventArgs e)
{
......@@ -158,7 +225,7 @@ namespace HZH_Controls.Controls
/// <summary>
/// 设置选中项
/// </summary>
/// <param name="strKey"></param>
/// <param name="strKey">The string key.</param>
public void SetSelect(string strKey)
{
foreach (UCBtnExt item in this.panMain.Controls)
......@@ -234,6 +301,11 @@ namespace HZH_Controls.Controls
}
#endregion
/// <summary>
/// Handles the BtnClick event of the btn 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 btn_BtnClick(object sender, EventArgs e)
{
var btn = (UCBtnExt)sender;
......
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:UCKeyBorderAll.cs
// 创建日期:2019-08-15 16:00:06
// 功能描述:KeyBord
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-08-2019
//
// ***********************************************************************
// <copyright file="UCKeyBorderAll.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;
......@@ -14,11 +24,23 @@ using System.Windows.Forms;
namespace HZH_Controls.Controls
{
/// <summary>
/// Class UCKeyBorderAll.
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
[DefaultEvent("KeyDown")]
public partial class UCKeyBorderAll : UserControl
{
/// <summary>
/// The character type
/// </summary>
private KeyBorderCharType _charType = KeyBorderCharType.CHAR;
/// <summary>
/// Gets or sets the type of the character.
/// </summary>
/// <value>The type of the character.</value>
[Description("默认显示样式"), Category("自定义")]
public KeyBorderCharType CharType
{
......@@ -42,19 +64,39 @@ namespace HZH_Controls.Controls
}
}
}
/// <summary>
/// Occurs when [key click].
/// </summary>
[Description("按键点击事件"), Category("自定义")]
public event EventHandler KeyClick;
/// <summary>
/// Occurs when [enter click].
/// </summary>
[Description("回车点击事件"), Category("自定义")]
public event EventHandler EnterClick;
/// <summary>
/// Occurs when [backspace clike].
/// </summary>
[Description("删除点击事件"), Category("自定义")]
public event EventHandler BackspaceClike;
/// <summary>
/// Occurs when [retract clike].
/// </summary>
[Description("收起点击事件"), Category("自定义")]
public event EventHandler RetractClike;
/// <summary>
/// Initializes a new instance of the <see cref="UCKeyBorderAll" /> class.
/// </summary>
public UCKeyBorderAll()
{
InitializeComponent();
}
/// <summary>
/// Handles the MouseDown event of the KeyDown control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
private void KeyDown_MouseDown(object sender, MouseEventArgs e)
{
Label lbl = sender as Label;
......@@ -105,6 +147,10 @@ namespace HZH_Controls.Controls
KeyClick(sender, e);
}
/// <summary>
/// Converts to uper.
/// </summary>
/// <param name="bln">if set to <c>true</c> [BLN].</param>
private void ToUper(bool bln)
{
foreach (Control item in this.tableLayoutPanel2.Controls)
......@@ -132,6 +178,9 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// Characters the or number.
/// </summary>
private void CharOrNum()
{
foreach (Control item in this.tableLayoutPanel2.Controls)
......@@ -152,9 +201,18 @@ namespace HZH_Controls.Controls
}
}
}
/// <summary>
/// Enum KeyBorderCharType
/// </summary>
public enum KeyBorderCharType
{
/// <summary>
/// The character
/// </summary>
CHAR = 1,
/// <summary>
/// The number
/// </summary>
NUMBER = 2
}
}
namespace HZH_Controls.Controls
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-08-2019
//
// ***********************************************************************
// <copyright file="UCKeyBorderNum.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 UCKeyBorderNum.
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
partial class UCKeyBorderNum
{
/// <summary>
......@@ -830,60 +850,225 @@
#endregion
/// <summary>
/// The table layout panel1
/// </summary>
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
/// <summary>
/// The panel1
/// </summary>
private System.Windows.Forms.Panel panel1;
/// <summary>
/// The panel14
/// </summary>
private System.Windows.Forms.Panel panel14;
/// <summary>
/// The uc split line V14
/// </summary>
private UCSplitLine_V ucSplitLine_V14;
/// <summary>
/// The panel13
/// </summary>
private System.Windows.Forms.Panel panel13;
/// <summary>
/// The uc split line V13
/// </summary>
private UCSplitLine_V ucSplitLine_V13;
/// <summary>
/// The panel12
/// </summary>
private System.Windows.Forms.Panel panel12;
/// <summary>
/// The uc split line V12
/// </summary>
private UCSplitLine_V ucSplitLine_V12;
/// <summary>
/// The panel11
/// </summary>
private System.Windows.Forms.Panel panel11;
/// <summary>
/// The uc split line H11
/// </summary>
private UCSplitLine_H ucSplitLine_H11;
/// <summary>
/// The uc split line V11
/// </summary>
private UCSplitLine_V ucSplitLine_V11;
/// <summary>
/// The panel10
/// </summary>
private System.Windows.Forms.Panel panel10;
/// <summary>
/// The uc split line H10
/// </summary>
private UCSplitLine_H ucSplitLine_H10;
/// <summary>
/// The uc split line V10
/// </summary>
private UCSplitLine_V ucSplitLine_V10;
/// <summary>
/// The panel9
/// </summary>
private System.Windows.Forms.Panel panel9;
/// <summary>
/// The uc split line h9
/// </summary>
private UCSplitLine_H ucSplitLine_H9;
/// <summary>
/// The uc split line v9
/// </summary>
private UCSplitLine_V ucSplitLine_V9;
/// <summary>
/// The panel8
/// </summary>
private System.Windows.Forms.Panel panel8;
/// <summary>
/// The uc split line h8
/// </summary>
private UCSplitLine_H ucSplitLine_H8;
/// <summary>
/// The uc split line v8
/// </summary>
private UCSplitLine_V ucSplitLine_V8;
/// <summary>
/// The panel7
/// </summary>
private System.Windows.Forms.Panel panel7;
/// <summary>
/// The panel6
/// </summary>
private System.Windows.Forms.Panel panel6;
/// <summary>
/// The uc split line h6
/// </summary>
private UCSplitLine_H ucSplitLine_H6;
/// <summary>
/// The uc split line v6
/// </summary>
private UCSplitLine_V ucSplitLine_V6;
/// <summary>
/// The panel5
/// </summary>
private System.Windows.Forms.Panel panel5;
/// <summary>
/// The uc split line h5
/// </summary>
private UCSplitLine_H ucSplitLine_H5;
/// <summary>
/// The uc split line v5
/// </summary>
private UCSplitLine_V ucSplitLine_V5;
/// <summary>
/// The panel4
/// </summary>
private System.Windows.Forms.Panel panel4;
/// <summary>
/// The uc split line h4
/// </summary>
private UCSplitLine_H ucSplitLine_H4;
/// <summary>
/// The uc split line v4
/// </summary>
private UCSplitLine_V ucSplitLine_V4;
/// <summary>
/// The panel3
/// </summary>
private System.Windows.Forms.Panel panel3;
/// <summary>
/// The uc split line h3
/// </summary>
private UCSplitLine_H ucSplitLine_H3;
/// <summary>
/// The panel2
/// </summary>
private System.Windows.Forms.Panel panel2;
/// <summary>
/// The uc split line h2
/// </summary>
private UCSplitLine_H ucSplitLine_H2;
/// <summary>
/// The uc split line v2
/// </summary>
private UCSplitLine_V ucSplitLine_V2;
/// <summary>
/// The uc split line h1
/// </summary>
private UCSplitLine_H ucSplitLine_H1;
/// <summary>
/// The uc split line v1
/// </summary>
private UCSplitLine_V ucSplitLine_V1;
/// <summary>
/// The label11
/// </summary>
private System.Windows.Forms.Label label11;
/// <summary>
/// The label12
/// </summary>
private System.Windows.Forms.Label label12;
/// <summary>
/// The label13
/// </summary>
private System.Windows.Forms.Label label13;
/// <summary>
/// The label10
/// </summary>
private System.Windows.Forms.Label label10;
/// <summary>
/// The label9
/// </summary>
private System.Windows.Forms.Label label9;
/// <summary>
/// The label8
/// </summary>
private System.Windows.Forms.Label label8;
/// <summary>
/// The label6
/// </summary>
private System.Windows.Forms.Label label6;
/// <summary>
/// The label14
/// </summary>
private System.Windows.Forms.Label label14;
/// <summary>
/// The label7
/// </summary>
private System.Windows.Forms.Label label7;
/// <summary>
/// The label3
/// </summary>
private System.Windows.Forms.Label label3;
/// <summary>
/// The label5
/// </summary>
private System.Windows.Forms.Label label5;
/// <summary>
/// The label4
/// </summary>
private System.Windows.Forms.Label label4;
/// <summary>
/// The label2
/// </summary>
private System.Windows.Forms.Label label2;
/// <summary>
/// The label1
/// </summary>
private System.Windows.Forms.Label label1;
/// <summary>
/// The uc split line v3
/// </summary>
private UCSplitLine_V ucSplitLine_V3;
/// <summary>
/// The uc split line v7
/// </summary>
private UCSplitLine_V ucSplitLine_V7;
/// <summary>
/// The uc split line h7
/// </summary>
private UCSplitLine_H ucSplitLine_H7;
/// <summary>
/// The uc split line H12
/// </summary>
private UCSplitLine_H ucSplitLine_H12;
}
}
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:UCKeyBorderNum.cs
// 创建日期:2019-08-15 16:00:10
// 功能描述:KeyBord
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-08-2019
//
// ***********************************************************************
// <copyright file="UCKeyBorderNum.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;
......@@ -14,29 +24,55 @@ using System.Windows.Forms;
namespace HZH_Controls.Controls
{
/// <summary>
/// Class UCKeyBorderNum.
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
public partial class UCKeyBorderNum : UserControl
{
/// <summary>
/// The use custom event
/// </summary>
private bool useCustomEvent = false;
/// <summary>
/// 是否使用自定义的事件来接收按键,当为true时将不再向系统发送按键请求
/// </summary>
/// <value><c>true</c> if [use custom event]; otherwise, <c>false</c>.</value>
[Description("是否使用自定义的事件来接收按键,当为true时将不再向系统发送按键请求"), Category("自定义")]
public bool UseCustomEvent
{
get { return useCustomEvent; }
set { useCustomEvent = value; }
}
/// <summary>
/// Occurs when [number click].
/// </summary>
[Description("数字点击事件"), Category("自定义")]
public event EventHandler NumClick;
/// <summary>
/// Occurs when [backspace click].
/// </summary>
[Description("删除点击事件"), Category("自定义")]
public event EventHandler BackspaceClick;
/// <summary>
/// Occurs when [enter click].
/// </summary>
[Description("回车点击事件"), Category("自定义")]
public event EventHandler EnterClick;
/// <summary>
/// Initializes a new instance of the <see cref="UCKeyBorderNum" /> class.
/// </summary>
public UCKeyBorderNum()
{
InitializeComponent();
}
/// <summary>
/// Handles the MouseDown event of the Num control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
private void Num_MouseDown(object sender, MouseEventArgs e)
{
if (NumClick != null)
......@@ -49,6 +85,11 @@ namespace HZH_Controls.Controls
SendKeys.Send(lbl.Tag.ToString());
}
/// <summary>
/// Handles the MouseDown event of the Backspace control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
private void Backspace_MouseDown(object sender, MouseEventArgs e)
{
if (BackspaceClick != null)
......@@ -61,6 +102,11 @@ namespace HZH_Controls.Controls
SendKeys.Send("{BACKSPACE}");
}
/// <summary>
/// Handles the MouseDown event of the Enter control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
private void Enter_MouseDown(object sender, MouseEventArgs e)
{
if (EnterClick != null)
......
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:UCKeyBorderPay.cs
// 创建日期:2019-08-15 16:00:14
// 功能描述:KeyBord
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-08-2019
//
// ***********************************************************************
// <copyright file="UCKeyBorderPay.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;
......@@ -14,22 +24,45 @@ using System.Windows.Forms;
namespace HZH_Controls.Controls
{
/// <summary>
/// Class UCKeyBorderPay.
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
public partial class UCKeyBorderPay : UserControl
{
/// <summary>
/// Occurs when [number click].
/// </summary>
[Description("数字点击事件"), Category("自定义")]
public event EventHandler NumClick;
/// <summary>
/// Occurs when [cancel click].
/// </summary>
[Description("取消点击事件"), Category("自定义")]
public event EventHandler CancelClick;
/// <summary>
/// Occurs when [ok click].
/// </summary>
[Description("确定点击事件"), Category("自定义")]
public event EventHandler OKClick;
/// <summary>
/// Occurs when [backspace click].
/// </summary>
[Description("删除点击事件"), Category("自定义")]
public event EventHandler BackspaceClick;
/// <summary>
/// Occurs when [money click].
/// </summary>
[Description("金额点击事件"), Category("自定义")]
public event EventHandler MoneyClick;
/// <summary>
/// Initializes a new instance of the <see cref="UCKeyBorderPay" /> class.
/// </summary>
public UCKeyBorderPay()
{
InitializeComponent();
......@@ -149,6 +182,10 @@ namespace HZH_Controls.Controls
}
#endregion
/// <summary>
/// Sets the fast money to contrl.
/// </summary>
/// <param name="values">The values.</param>
private void SetFastMoneyToContrl(List<decimal> values)
{
List<Label> lbl = new List<Label>() { lblFast1, lblFast2, lblFast3, lblFast4 };
......@@ -179,51 +216,88 @@ namespace HZH_Controls.Controls
lbl[i].Tag = lbl[i].Text = values[i].ToString("0.##");
}
}
/// <summary>
/// Handles the MouseDown event of the Num control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
private void Num_MouseDown(object sender, MouseEventArgs e)
{
if (NumClick != null)
NumClick((sender as Label).Tag, e);
}
/// <summary>
/// Handles the MouseDown event of the Backspace control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
private void Backspace_MouseDown(object sender, MouseEventArgs e)
{
if (BackspaceClick != null)
BackspaceClick((sender as Label).Tag, e);
}
/// <summary>
/// Handles the MouseDown event of the Cancel control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
private void Cancel_MouseDown(object sender, MouseEventArgs e)
{
if (CancelClick != null)
CancelClick((sender as Label).Tag, e);
}
/// <summary>
/// Handles the MouseDown event of the OK control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
private void OK_MouseDown(object sender, MouseEventArgs e)
{
if (OKClick != null)
OKClick((sender as Label).Tag, e);
}
/// <summary>
/// Handles the MouseDown event of the Money control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
private void Money_MouseDown(object sender, MouseEventArgs e)
{
if (MoneyClick != null)
MoneyClick((sender as Label).Tag, e);
}
/// <summary>
/// Money1s the click.
/// </summary>
public void Money1Click()
{
Money_MouseDown(lblFast1, null);
}
/// <summary>
/// Money2s the click.
/// </summary>
public void Money2Click()
{
Money_MouseDown(lblFast2, null);
}
/// <summary>
/// Money3s the click.
/// </summary>
public void Money3Click()
{
Money_MouseDown(lblFast3, null);
}
/// <summary>
/// Money4s the click.
/// </summary>
public void Money4Click()
{
Money_MouseDown(lblFast4, null);
......
namespace HZH_Controls.Controls
// ***********************************************************************
// 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>
......@@ -188,16 +208,49 @@
#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;
}
......
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:UCLEDData.cs
// 作  者:HZH
// 创建日期:2019-09-02 16:22:48
// 功能描述:UCLEDData English:UCLEDData
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// 项目地址:https://github.com/kwwwvagaa/NetWinformControl
// 如果你使用了此类,请保留以上说明
// ***********************************************************************
// 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;
......@@ -17,10 +24,22 @@ 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
{
......@@ -36,8 +55,15 @@ namespace HZH_Controls.Controls
}
}
/// <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
{
......@@ -52,6 +78,13 @@ namespace HZH_Controls.Controls
}
}
/// <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
{
......@@ -68,6 +101,9 @@ namespace HZH_Controls.Controls
}
}
}
/// <summary>
/// Initializes a new instance of the <see cref="UCLEDData" /> class.
/// </summary>
public UCLEDData()
{
InitializeComponent();
......
namespace HZH_Controls.Controls
// ***********************************************************************
// 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>
......@@ -291,24 +311,81 @@
#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;
}
}
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:UCLEDDataTime.cs
// 作  者:HZH
// 创建日期:2019-09-02 16:22:53
// 功能描述:UCLEDDataTime English:UCLEDDataTime
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// 项目地址:https://github.com/kwwwvagaa/NetWinformControl
// 如果你使用了此类,请保留以上说明
// ***********************************************************************
// 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;
......@@ -17,10 +24,22 @@ 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
{
......@@ -38,8 +57,15 @@ namespace HZH_Controls.Controls
}
}
/// <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
{
......@@ -54,6 +80,13 @@ namespace HZH_Controls.Controls
}
}
/// <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
{
......@@ -70,6 +103,9 @@ namespace HZH_Controls.Controls
}
}
}
/// <summary>
/// Initializes a new instance of the <see cref="UCLEDDataTime" /> class.
/// </summary>
public UCLEDDataTime()
{
InitializeComponent();
......
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:UCLEDNum.cs
// 作  者:HZH
// 创建日期:2019-09-02 16:22:59
// 功能描述:UCLEDNum English:UCLEDNum
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// 项目地址:https://github.com/kwwwvagaa/NetWinformControl
// 如果你使用了此类,请保留以上说明
// ***********************************************************************
// 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;
......@@ -28,11 +35,25 @@ namespace HZH_Controls.Controls
* * *
* ****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 };
......@@ -51,6 +72,9 @@ namespace HZH_Controls.Controls
}
/// <summary>
/// Initializes a new instance of the <see cref="UCLEDNum" /> class.
/// </summary>
public UCLEDNum()
{
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
......@@ -66,13 +90,25 @@ namespace HZH_Controls.Controls
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
{
......@@ -91,8 +127,15 @@ namespace HZH_Controls.Controls
}
}
/// <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
{
......@@ -104,6 +147,13 @@ namespace HZH_Controls.Controls
}
}
/// <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
{
......@@ -117,6 +167,10 @@ namespace HZH_Controls.Controls
}
}
/// <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);
......
namespace HZH_Controls.Controls.LED
// ***********************************************************************
// 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>
......
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:UCLEDNums.cs
// 作  者:HZH
// 创建日期:2019-09-02 16:23:03
// 功能描述:UCLEDNums English:UCLEDNums
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// 项目地址:https://github.com/kwwwvagaa/NetWinformControl
// 如果你使用了此类,请保留以上说明
// ***********************************************************************
// 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;
......@@ -15,12 +22,24 @@ using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls.LED
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
{
......@@ -32,8 +51,15 @@ namespace HZH_Controls.Controls.LED
}
}
/// <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
{
......@@ -48,6 +74,13 @@ namespace HZH_Controls.Controls.LED
}
}
/// <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
{
......@@ -65,6 +98,16 @@ namespace HZH_Controls.Controls.LED
}
}
/// <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
......@@ -78,6 +121,9 @@ namespace HZH_Controls.Controls.LED
}
}
/// <summary>
/// Reloads the value.
/// </summary>
private void ReloadValue()
{
try
......@@ -106,6 +152,9 @@ namespace HZH_Controls.Controls.LED
ControlHelper.FreezeControl(this, false);
}
}
/// <summary>
/// Initializes a new instance of the <see cref="UCLEDNums" /> class.
/// </summary>
public UCLEDNums()
{
InitializeComponent();
......
namespace HZH_Controls.Controls
// ***********************************************************************
// 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>
......@@ -160,14 +180,41 @@
#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;
}
}
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:UCLEDTime.cs
// 作  者:HZH
// 创建日期:2019-09-02 16:23:08
// 功能描述:UCLEDTime English:UCLEDTime
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// 项目地址:https://github.com/kwwwvagaa/NetWinformControl
// 如果你使用了此类,请保留以上说明
// ***********************************************************************
// 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;
......@@ -17,10 +24,22 @@ 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
{
......@@ -36,8 +55,15 @@ namespace HZH_Controls.Controls
}
}
/// <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
{
......@@ -52,6 +78,13 @@ namespace HZH_Controls.Controls
}
}
/// <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
{
......@@ -68,6 +101,9 @@ namespace HZH_Controls.Controls
}
}
}
/// <summary>
/// Initializes a new instance of the <see cref="UCLEDTime" /> class.
/// </summary>
public UCLEDTime()
{
InitializeComponent();
......
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:IListViewItem.cs
// 作  者:HZH
// 创建日期:2019-08-31 16:03:22
// 功能描述:IListViewItem English:IListViewItem
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// 项目地址:https://github.com/kwwwvagaa/NetWinformControl
// 如果你使用了此类,请保留以上说明
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-22-2019
//
// ***********************************************************************
// <copyright file="IListViewItem.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;
......@@ -13,11 +20,15 @@ using System.Text;
namespace HZH_Controls.Controls
{
/// <summary>
/// Interface IListViewItem
/// </summary>
public interface IListViewItem
{
/// <summary>
/// 数据源
/// </summary>
/// <value>The data source.</value>
object DataSource { get; set; }
/// <summary>
/// 选中项事件
......
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:IPageControl.cs
// 创建日期:2019-08-15 16:00:24
// 功能描述:PageControl
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-09-2019
//
// ***********************************************************************
// <copyright file="IPageControl.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;
......@@ -10,6 +20,9 @@ using System.Text;
namespace HZH_Controls.Controls
{
/// <summary>
/// Interface IPageControl
/// </summary>
public interface IPageControl
{
/// <summary>
......@@ -19,14 +32,17 @@ namespace HZH_Controls.Controls
/// <summary>
/// 数据源
/// </summary>
/// <value>The data source.</value>
List<object> DataSource { get; set; }
/// <summary>
/// 显示数量
/// </summary>
/// <value>The size of the page.</value>
int PageSize { get; set; }
/// <summary>
/// 开始下标
/// </summary>
/// <value>The start index.</value>
int StartIndex { get; set; }
/// <summary>
/// 第一页
......@@ -51,15 +67,17 @@ namespace HZH_Controls.Controls
/// <summary>
/// 获取当前页数据
/// </summary>
/// <returns></returns>
/// <returns>List&lt;System.Object&gt;.</returns>
List<object> GetCurrentSource();
/// <summary>
/// 总页数
/// </summary>
/// <value>The page count.</value>
int PageCount { get; set; }
/// <summary>
/// 当前页
/// </summary>
/// <value>The index of the page.</value>
int PageIndex { get; set; }
}
}
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:PageControlEventHandler.cs
// 创建日期:2019-08-15 16:00:47
// 功能描述:PageControl
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-09-2019
//
// ***********************************************************************
// <copyright file="PageControlEventHandler.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;
......@@ -11,6 +21,10 @@ using System.Text;
namespace HZH_Controls.Controls
{
/// <summary>
/// Delegate PageControlEventHandler
/// </summary>
/// <param name="currentSource">The current source.</param>
[Serializable]
[ComVisible(true)]
public delegate void PageControlEventHandler(object currentSource);
......
namespace HZH_Controls.Controls
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-08-2019
//
// ***********************************************************************
// <copyright file="UCHorizontalList.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 UCHorizontalList.
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
partial class UCHorizontalList
{
/// <summary>
......@@ -92,9 +112,21 @@
#endregion
/// <summary>
/// The pan left
/// </summary>
private System.Windows.Forms.Panel panLeft;
/// <summary>
/// The pan right
/// </summary>
private System.Windows.Forms.Panel panRight;
/// <summary>
/// The pan main
/// </summary>
private System.Windows.Forms.Panel panMain;
/// <summary>
/// The pan list
/// </summary>
private System.Windows.Forms.Panel panList;
}
}
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:UCHorizontalList.cs
// 创建日期:2019-08-15 16:01:06
// 功能描述:HorizontalList
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-08-2019
//
// ***********************************************************************
// <copyright file="UCHorizontalList.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;
......@@ -14,21 +24,50 @@ using System.Windows.Forms;
namespace HZH_Controls.Controls
{
/// <summary>
/// Class UCHorizontalList.
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
public partial class UCHorizontalList : UserControl
{
/// <summary>
/// Gets or sets the selected item.
/// </summary>
/// <value>The selected item.</value>
public UCHorizontalListItem SelectedItem { get; set; }
/// <summary>
/// Occurs when [selected item event].
/// </summary>
public event EventHandler SelectedItemEvent;
/// <summary>
/// The m start item index
/// </summary>
private int m_startItemIndex = 0;
/// <summary>
/// The is automatic select first
/// </summary>
private bool isAutoSelectFirst = true;
/// <summary>
/// Gets or sets a value indicating whether this instance is automatic select first.
/// </summary>
/// <value><c>true</c> if this instance is automatic select first; otherwise, <c>false</c>.</value>
public bool IsAutoSelectFirst
{
get { return isAutoSelectFirst; }
set { isAutoSelectFirst = value; }
}
/// <summary>
/// The data source
/// </summary>
private List<KeyValuePair<string, string>> dataSource = null;
/// <summary>
/// Gets or sets the data source.
/// </summary>
/// <value>The data source.</value>
public List<KeyValuePair<string, string>> DataSource
{
get { return dataSource; }
......@@ -39,11 +78,17 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// Initializes a new instance of the <see cref="UCHorizontalList" /> class.
/// </summary>
public UCHorizontalList()
{
InitializeComponent();
}
/// <summary>
/// Reloads the source.
/// </summary>
public void ReloadSource()
{
try
......@@ -85,11 +130,20 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// Handles the SelectItem event of the uc 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 uc_SelectItem(object sender, EventArgs e)
{
SelectItem(sender as UCHorizontalListItem);
}
/// <summary>
/// Selects the item.
/// </summary>
/// <param name="item">The item.</param>
private void SelectItem(UCHorizontalListItem item)
{
if (SelectedItem != null && !SelectedItem.IsDisposed)
......@@ -100,6 +154,11 @@ namespace HZH_Controls.Controls
SelectedItemEvent(item, null);
}
/// <summary>
/// Handles the MouseDown event of the panLeft control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
private void panLeft_MouseDown(object sender, MouseEventArgs e)
{
if (this.panList.Location.X >= 0)
......@@ -135,6 +194,11 @@ namespace HZH_Controls.Controls
panRight.SendToBack();
}
/// <summary>
/// Handles the MouseDown event of the panRight control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
private void panRight_MouseDown(object sender, MouseEventArgs e)
{
if (this.panList.Location.X + this.panList.Width <= this.panMain.Width)
......@@ -159,6 +223,9 @@ namespace HZH_Controls.Controls
panRight.SendToBack();
}
/// <summary>
/// Resets the list location.
/// </summary>
private void ResetListLocation()
{
if (this.panList.Controls.Count > 0)
......@@ -167,6 +234,10 @@ namespace HZH_Controls.Controls
}
}
/// <summary>
/// Sets the select.
/// </summary>
/// <param name="strKey">The string key.</param>
public void SetSelect(string strKey)
{
foreach (UCHorizontalListItem item in this.panList.Controls)
......
namespace HZH_Controls.Controls
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-08-2019
//
// ***********************************************************************
// <copyright file="UCHorizontalListItem.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 UCHorizontalListItem.
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
partial class UCHorizontalListItem
{
/// <summary>
......@@ -69,7 +89,13 @@
#endregion
/// <summary>
/// The uc split line h1
/// </summary>
private UCSplitLine_H ucSplitLine_H1;
/// <summary>
/// The label title
/// </summary>
private System.Windows.Forms.Label lblTitle;
}
}
// 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:UCHorizontalListItem.cs
// 创建日期:2019-08-15 16:01:13
// 功能描述:HorizontalList
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 08-08-2019
//
// ***********************************************************************
// <copyright file="UCHorizontalListItem.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;
......@@ -14,11 +24,26 @@ using System.Windows.Forms;
namespace HZH_Controls.Controls
{
/// <summary>
/// Class UCHorizontalListItem.
/// Implements the <see cref="System.Windows.Forms.UserControl" />
/// </summary>
/// <seealso cref="System.Windows.Forms.UserControl" />
[ToolboxItem(false)]
public partial class UCHorizontalListItem : UserControl
{
/// <summary>
/// Occurs when [selected item].
/// </summary>
public event EventHandler SelectedItem;
/// <summary>
/// The data source
/// </summary>
private KeyValuePair<string, string> _DataSource = new KeyValuePair<string, string>();
/// <summary>
/// Gets or sets the data source.
/// </summary>
/// <value>The data source.</value>
public KeyValuePair<string, string> DataSource
{
get { return _DataSource; }
......@@ -35,6 +60,9 @@ namespace HZH_Controls.Controls
SetSelect(false);
}
}
/// <summary>
/// Initializes a new instance of the <see cref="UCHorizontalListItem" /> class.
/// </summary>
public UCHorizontalListItem()
{
InitializeComponent();
......@@ -44,12 +72,21 @@ namespace HZH_Controls.Controls
this.ucSplitLine_H1.MouseDown += Item_MouseDown;
}
/// <summary>
/// Handles the MouseDown event of the Item control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
void Item_MouseDown(object sender, MouseEventArgs e)
{
if (SelectedItem != null)
SelectedItem(this, e);
}
/// <summary>
/// Sets the select.
/// </summary>
/// <param name="bln">if set to <c>true</c> [BLN].</param>
public void SetSelect(bool bln)
{
if (bln)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!