Commit 3622c191 HZH

新增DataGridView,分页控件

1 个父辈 ee050c1b
正在显示 147 个修改的文件 包含 2756 行增加2198 行删除

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HZH_Controls", "HZH_Controls\HZH_Controls.csproj", "{AF32E163-C577-4CBC-A072-0DC1CE0E1DA3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "Test\Test.csproj", "{53CCD007-AA85-4CCF-AE81-BBB8B1CBEB1F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AF32E163-C577-4CBC-A072-0DC1CE0E1DA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AF32E163-C577-4CBC-A072-0DC1CE0E1DA3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AF32E163-C577-4CBC-A072-0DC1CE0E1DA3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AF32E163-C577-4CBC-A072-0DC1CE0E1DA3}.Release|Any CPU.Build.0 = Release|Any CPU
{53CCD007-AA85-4CCF-AE81-BBB8B1CBEB1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{53CCD007-AA85-4CCF-AE81-BBB8B1CBEB1F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{53CCD007-AA85-4CCF-AE81-BBB8B1CBEB1F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{53CCD007-AA85-4CCF-AE81-BBB8B1CBEB1F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HZH_Controls", "HZH_Controls\HZH_Controls.csproj", "{AF32E163-C577-4CBC-A072-0DC1CE0E1DA3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "Test\Test.csproj", "{53CCD007-AA85-4CCF-AE81-BBB8B1CBEB1F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AF32E163-C577-4CBC-A072-0DC1CE0E1DA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AF32E163-C577-4CBC-A072-0DC1CE0E1DA3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AF32E163-C577-4CBC-A072-0DC1CE0E1DA3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AF32E163-C577-4CBC-A072-0DC1CE0E1DA3}.Release|Any CPU.Build.0 = Release|Any CPU
{53CCD007-AA85-4CCF-AE81-BBB8B1CBEB1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{53CCD007-AA85-4CCF-AE81-BBB8B1CBEB1F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{53CCD007-AA85-4CCF-AE81-BBB8B1CBEB1F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{53CCD007-AA85-4CCF-AE81-BBB8B1CBEB1F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
namespace HZH_Controls.Controls
{
public partial class UCBtnExt
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UCBtnExt));
this.lbl = new System.Windows.Forms.Label();
this.lblTips = new System.Windows.Forms.Label();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.SuspendLayout();
//
// lbl
//
this.lbl.BackColor = System.Drawing.Color.Transparent;
this.lbl.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbl.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbl.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.lbl.Location = new System.Drawing.Point(0, 0);
this.lbl.Name = "lbl";
this.lbl.Size = new System.Drawing.Size(184, 60);
this.lbl.TabIndex = 0;
this.lbl.Text = "自定义按钮";
this.lbl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lbl.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lbl_MouseDown);
//
// lblTips
//
this.lblTips.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.lblTips.BackColor = System.Drawing.Color.Transparent;
this.lblTips.Font = new System.Drawing.Font("Arial Unicode MS", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblTips.ForeColor = System.Drawing.Color.White;
this.lblTips.ImageIndex = 0;
this.lblTips.ImageList = this.imageList1;
this.lblTips.Location = new System.Drawing.Point(158, 0);
this.lblTips.Name = "lblTips";
this.lblTips.Size = new System.Drawing.Size(24, 24);
this.lblTips.TabIndex = 1;
this.lblTips.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lblTips.Visible = false;
//
// imageList1
//
this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
this.imageList1.Images.SetKeyName(0, "tips.png");
//
// UCBtnExt
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.Transparent;
this.ConerRadius = 5;
this.Controls.Add(this.lblTips);
this.Controls.Add(this.lbl);
this.Cursor = System.Windows.Forms.Cursors.Hand;
this.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(247)))), ((int)(((byte)(247)))), ((int)(((byte)(247)))));
this.IsShowRect = true;
this.IsRadius = true;
this.Margin = new System.Windows.Forms.Padding(0);
this.Name = "UCBtnExt";
this.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(247)))), ((int)(((byte)(247)))), ((int)(((byte)(247)))));
this.Size = new System.Drawing.Size(184, 60);
this.ResumeLayout(false);
}
#endregion
public System.Windows.Forms.Label lbl;
private System.Windows.Forms.Label lblTips;
private System.Windows.Forms.ImageList imageList1;
}
}
namespace HZH_Controls.Controls
{
public partial class UCBtnExt
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UCBtnExt));
this.lbl = new System.Windows.Forms.Label();
this.lblTips = new System.Windows.Forms.Label();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.SuspendLayout();
//
// lbl
//
this.lbl.BackColor = System.Drawing.Color.Transparent;
this.lbl.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbl.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lbl.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.lbl.Location = new System.Drawing.Point(0, 0);
this.lbl.Name = "lbl";
this.lbl.Size = new System.Drawing.Size(184, 60);
this.lbl.TabIndex = 0;
this.lbl.Text = "自定义按钮";
this.lbl.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lbl.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lbl_MouseDown);
//
// lblTips
//
this.lblTips.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.lblTips.BackColor = System.Drawing.Color.Transparent;
this.lblTips.Font = new System.Drawing.Font("Arial Unicode MS", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblTips.ForeColor = System.Drawing.Color.White;
this.lblTips.ImageIndex = 0;
this.lblTips.ImageList = this.imageList1;
this.lblTips.Location = new System.Drawing.Point(158, 0);
this.lblTips.Name = "lblTips";
this.lblTips.Size = new System.Drawing.Size(24, 24);
this.lblTips.TabIndex = 1;
this.lblTips.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lblTips.Visible = false;
//
// imageList1
//
this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
this.imageList1.Images.SetKeyName(0, "tips.png");
//
// UCBtnExt
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.Transparent;
this.ConerRadius = 5;
this.Controls.Add(this.lblTips);
this.Controls.Add(this.lbl);
this.Cursor = System.Windows.Forms.Cursors.Hand;
this.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(247)))), ((int)(((byte)(247)))), ((int)(((byte)(247)))));
this.IsShowRect = true;
this.IsRadius = true;
this.Margin = new System.Windows.Forms.Padding(0);
this.Name = "UCBtnExt";
this.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(247)))), ((int)(((byte)(247)))), ((int)(((byte)(247)))));
this.Size = new System.Drawing.Size(184, 60);
this.ResumeLayout(false);
}
#endregion
public System.Windows.Forms.Label lbl;
private System.Windows.Forms.Label lblTips;
private System.Windows.Forms.ImageList imageList1;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
[DefaultEvent("BtnClick")]
public partial class UCBtnExt : UCControlBase
{
#region 字段属性
[Description("是否显示角标"), Category("自定义")]
public bool IsShowTips
{
get
{
return this.lblTips.Visible;
}
set
{
this.lblTips.Visible = value;
}
}
[Description("角标文字"), Category("自定义")]
public string TipsText
{
get
{
return this.lblTips.Text;
}
set
{
this.lblTips.Text = value;
}
}
private Color _btnBackColor = Color.White;
[Description("按钮背景色"), Category("自定义")]
public Color BtnBackColor
{
get { return _btnBackColor; }
set
{
_btnBackColor = value;
this.BackColor = value;
}
}
private Color _btnForeColor = Color.Black;
/// <summary>
/// 按钮字体颜色
/// </summary>
[Description("按钮字体颜色"), Category("自定义")]
public Color BtnForeColor
{
get { return _btnForeColor; }
set
{
_btnForeColor = value;
this.lbl.ForeColor = value;
}
}
private Font _btnFont = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
/// <summary>
/// 按钮字体
/// </summary>
[Description("按钮字体"), Category("自定义")]
public Font BtnFont
{
get { return _btnFont; }
set
{
_btnFont = value;
this.lbl.Font = value;
}
}
/// <summary>
/// 按钮点击事件
/// </summary>
[Description("按钮点击事件"), Category("自定义")]
public event EventHandler BtnClick;
private string _btnText;
/// <summary>
/// 按钮文字
/// </summary>
[Description("按钮文字"), Category("自定义")]
public string BtnText
{
get { return _btnText; }
set
{
_btnText = value;
lbl.Text = value;
}
}
#endregion
public UCBtnExt()
{
InitializeComponent();
this.TabStop = false;
}
private void lbl_MouseDown(object sender, MouseEventArgs e)
{
if (this.BtnClick != null)
BtnClick(this, e);
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
[DefaultEvent("BtnClick")]
public partial class UCBtnExt : UCControlBase
{
#region 字段属性
[Description("是否显示角标"), Category("自定义")]
public bool IsShowTips
{
get
{
return this.lblTips.Visible;
}
set
{
this.lblTips.Visible = value;
}
}
[Description("角标文字"), Category("自定义")]
public string TipsText
{
get
{
return this.lblTips.Text;
}
set
{
this.lblTips.Text = value;
}
}
private Color _btnBackColor = Color.White;
[Description("按钮背景色"), Category("自定义")]
public Color BtnBackColor
{
get { return _btnBackColor; }
set
{
_btnBackColor = value;
this.BackColor = value;
}
}
private Color _btnForeColor = Color.Black;
/// <summary>
/// 按钮字体颜色
/// </summary>
[Description("按钮字体颜色"), Category("自定义")]
public Color BtnForeColor
{
get { return _btnForeColor; }
set
{
_btnForeColor = value;
this.lbl.ForeColor = value;
}
}
private Font _btnFont = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
/// <summary>
/// 按钮字体
/// </summary>
[Description("按钮字体"), Category("自定义")]
public Font BtnFont
{
get { return _btnFont; }
set
{
_btnFont = value;
this.lbl.Font = value;
}
}
/// <summary>
/// 按钮点击事件
/// </summary>
[Description("按钮点击事件"), Category("自定义")]
public event EventHandler BtnClick;
private string _btnText;
/// <summary>
/// 按钮文字
/// </summary>
[Description("按钮文字"), Category("自定义")]
public string BtnText
{
get { return _btnText; }
set
{
_btnText = value;
lbl.Text = value;
}
}
#endregion
public UCBtnExt()
{
InitializeComponent();
this.TabStop = false;
}
private void lbl_MouseDown(object sender, MouseEventArgs e)
{
if (this.BtnClick != null)
BtnClick(this, e);
}
}
}
namespace HZH_Controls.Controls
{
partial class UCBtnFillet
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.lbl = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// lbl
//
this.lbl.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbl.Font = new System.Drawing.Font("微软雅黑", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.lbl.Image = global::HZH_Controls.Properties.Resources.alarm;
this.lbl.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.lbl.Location = new System.Drawing.Point(0, 0);
this.lbl.Name = "lbl";
this.lbl.Padding = new System.Windows.Forms.Padding(5, 0, 0, 0);
this.lbl.Size = new System.Drawing.Size(120, 76);
this.lbl.TabIndex = 0;
this.lbl.Text = "按钮1 ";
this.lbl.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lbl.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lbl_MouseDown);
//
// UCBtnFillet
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.Transparent;
this.ConerRadius = 5;
this.Controls.Add(this.lbl);
this.IsShowRect = true;
this.IsRadius = true;
this.Name = "UCBtnFillet";
this.Size = new System.Drawing.Size(120, 76);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label lbl;
}
}
namespace HZH_Controls.Controls
{
partial class UCBtnFillet
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.lbl = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// lbl
//
this.lbl.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbl.Font = new System.Drawing.Font("微软雅黑", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.lbl.Image = global::HZH_Controls.Properties.Resources.alarm;
this.lbl.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.lbl.Location = new System.Drawing.Point(0, 0);
this.lbl.Name = "lbl";
this.lbl.Padding = new System.Windows.Forms.Padding(5, 0, 0, 0);
this.lbl.Size = new System.Drawing.Size(120, 76);
this.lbl.TabIndex = 0;
this.lbl.Text = "按钮1 ";
this.lbl.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lbl.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lbl_MouseDown);
//
// UCBtnFillet
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.Transparent;
this.ConerRadius = 5;
this.Controls.Add(this.lbl);
this.IsShowRect = true;
this.IsRadius = true;
this.Name = "UCBtnFillet";
this.Size = new System.Drawing.Size(120, 76);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label lbl;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
[DefaultEvent("BtnClick")]
public partial class UCBtnFillet : UCControlBase
{
[Description("按钮点击事件"), Category("自定义")]
public event EventHandler BtnClick;
[Description("按钮图片"), Category("自定义")]
public Image BtnImage
{
get
{
return lbl.Image;
}
set
{
lbl.Image = value;
}
}
/// <summary>
/// 按钮文字
/// </summary>
[Description("按钮文字"), Category("自定义")]
public string BtnText
{
get { return lbl.Text; }
set
{
lbl.Text = value;
}
}
public UCBtnFillet()
{
InitializeComponent();
}
private void lbl_MouseDown(object sender, MouseEventArgs e)
{
if (BtnClick != null)
BtnClick(this, e);
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
[DefaultEvent("BtnClick")]
public partial class UCBtnFillet : UCControlBase
{
[Description("按钮点击事件"), Category("自定义")]
public event EventHandler BtnClick;
[Description("按钮图片"), Category("自定义")]
public Image BtnImage
{
get
{
return lbl.Image;
}
set
{
lbl.Image = value;
}
}
/// <summary>
/// 按钮文字
/// </summary>
[Description("按钮文字"), Category("自定义")]
public string BtnText
{
get { return lbl.Text; }
set
{
lbl.Text = value;
}
}
public UCBtnFillet()
{
InitializeComponent();
}
private void lbl_MouseDown(object sender, MouseEventArgs e)
{
if (BtnClick != null)
BtnClick(this, e);
}
}
}
namespace HZH_Controls.Controls
{
partial class UCBtnImg
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UCBtnImg));
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.SuspendLayout();
//
// lbl
//
//this.lbl.Font = new System.Drawing.Font("微软雅黑", 17F);
//this.lbl.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102)))));
this.lbl.ImageIndex = 0;
this.lbl.ImageList = this.imageList1;
this.lbl.Padding = new System.Windows.Forms.Padding(10, 0, 0, 0);
this.lbl.Text = " 自定义按钮";
this.lbl.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// imageList1
//
this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
this.imageList1.Images.SetKeyName(0, "back.png");
//
// BtnBack
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Name = "BtnBack";
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ImageList imageList1;
}
}
namespace HZH_Controls.Controls
{
partial class UCBtnImg
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UCBtnImg));
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.SuspendLayout();
//
// lbl
//
//this.lbl.Font = new System.Drawing.Font("微软雅黑", 17F);
//this.lbl.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102)))));
this.lbl.ImageIndex = 0;
this.lbl.ImageList = this.imageList1;
this.lbl.Padding = new System.Windows.Forms.Padding(10, 0, 0, 0);
this.lbl.Text = " 自定义按钮";
this.lbl.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// imageList1
//
this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
this.imageList1.Images.SetKeyName(0, "back.png");
//
// BtnBack
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Name = "BtnBack";
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ImageList imageList1;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
/// <summary>
///
/// </summary>
public partial class UCBtnImg : UCBtnExt
{
private string _btnText = "自定义按钮";
/// <summary>
/// 按钮文字
/// </summary>
[Description("按钮文字"), Category("自定义")]
public new string BtnText
{
get { return _btnText; }
set
{
_btnText = value;
lbl.Text = " " + value;
lbl.Refresh();
}
}
/// <summary>
/// 图片
/// </summary>
[Description("图片"), Category("自定义")]
public Image Image
{
get
{
return this.imageList1.Images[0];
}
set
{
this.imageList1.Images.Clear();
this.imageList1.Images.Add(value);
this.lbl.ImageIndex = 0;
}
}
public UCBtnImg()
{
InitializeComponent();
base.BtnForeColor = ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102)))));
base.BtnFont = new System.Drawing.Font("微软雅黑", 17F);
base.BtnText = " 自定义按钮";
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
/// <summary>
///
/// </summary>
public partial class UCBtnImg : UCBtnExt
{
private string _btnText = "自定义按钮";
/// <summary>
/// 按钮文字
/// </summary>
[Description("按钮文字"), Category("自定义")]
public new string BtnText
{
get { return _btnText; }
set
{
_btnText = value;
lbl.Text = " " + value;
lbl.Refresh();
}
}
/// <summary>
/// 图片
/// </summary>
[Description("图片"), Category("自定义")]
public Image Image
{
get
{
return this.imageList1.Images[0];
}
set
{
this.imageList1.Images.Clear();
this.imageList1.Images.Add(value);
this.lbl.ImageIndex = 0;
}
}
public UCBtnImg()
{
InitializeComponent();
base.BtnForeColor = ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102)))));
base.BtnFont = new System.Drawing.Font("微软雅黑", 17F);
base.BtnText = " 自定义按钮";
}
}
}
namespace HZH_Controls.Controls
{
partial class UCCheckBox
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.panel1 = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// panel1
//
this.panel1.BackgroundImage = global::HZH_Controls.Properties.Resources.checkbox0;
this.panel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.panel1.Dock = System.Windows.Forms.DockStyle.Left;
this.panel1.Location = new System.Drawing.Point(1, 1);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(18, 28);
this.panel1.TabIndex = 0;
this.panel1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.CheckBox_MouseDown);
//
// label1
//
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.Font = new System.Drawing.Font("微软雅黑", 12F);
this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(62)))), ((int)(((byte)(62)))), ((int)(((byte)(62)))));
this.label1.Location = new System.Drawing.Point(19, 1);
this.label1.Name = "label1";
this.label1.Padding = new System.Windows.Forms.Padding(5, 0, 0, 0);
this.label1.Size = new System.Drawing.Size(213, 28);
this.label1.TabIndex = 1;
this.label1.Text = "复选框";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.CheckBox_MouseDown);
//
// UCCheckBox
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.Transparent;
this.Controls.Add(this.label1);
this.Controls.Add(this.panel1);
this.Name = "UCCheckBox";
this.Padding = new System.Windows.Forms.Padding(1);
this.Size = new System.Drawing.Size(233, 30);
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.CheckBox_MouseDown);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label label1;
}
}
namespace HZH_Controls.Controls
{
partial class UCCheckBox
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.panel1 = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// panel1
//
this.panel1.BackgroundImage = global::HZH_Controls.Properties.Resources.checkbox0;
this.panel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.panel1.Dock = System.Windows.Forms.DockStyle.Left;
this.panel1.Location = new System.Drawing.Point(1, 1);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(18, 28);
this.panel1.TabIndex = 0;
this.panel1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.CheckBox_MouseDown);
//
// label1
//
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.Font = new System.Drawing.Font("微软雅黑", 12F);
this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(62)))), ((int)(((byte)(62)))), ((int)(((byte)(62)))));
this.label1.Location = new System.Drawing.Point(19, 1);
this.label1.Name = "label1";
this.label1.Padding = new System.Windows.Forms.Padding(5, 0, 0, 0);
this.label1.Size = new System.Drawing.Size(213, 28);
this.label1.TabIndex = 1;
this.label1.Text = "复选框";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.CheckBox_MouseDown);
//
// UCCheckBox
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.Transparent;
this.Controls.Add(this.label1);
this.Controls.Add(this.panel1);
this.Name = "UCCheckBox";
this.Padding = new System.Windows.Forms.Padding(1);
this.Size = new System.Drawing.Size(233, 30);
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.CheckBox_MouseDown);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label label1;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
[DefaultEvent("CheckedChangeEvent")]
public partial class UCCheckBox : UserControl
{
[Description("选中改变事件"), Category("自定义")]
public event EventHandler CheckedChangeEvent;
[Description("字体"), Category("自定义")]
public override Font Font
{
get
{
return base.Font;
}
set
{
base.Font = value;
label1.Font = value;
}
}
private Color _ForeColor = Color.FromArgb(62, 62, 62);
[Description("字体颜色"), Category("自定义")]
public new Color ForeColor
{
get { return _ForeColor; }
set
{
label1.ForeColor = value;
_ForeColor = value;
}
}
private string _Text = "复选框";
[Description("文本"), Category("自定义")]
public string TextValue
{
get { return _Text; }
set
{
label1.Text = value;
_Text = value;
}
}
private bool _checked = false;
[Description("是否选中"), Category("自定义")]
public bool Checked
{
get
{
return _checked;
}
set
{
if (_checked != value)
{
_checked = value;
if (base.Enabled)
{
if (_checked)
{
panel1.BackgroundImage = Properties.Resources.checkbox1;
}
else
{
panel1.BackgroundImage = Properties.Resources.checkbox0;
}
}
else
{
if (_checked)
{
panel1.BackgroundImage = Properties.Resources.checkbox10;
}
else
{
panel1.BackgroundImage = Properties.Resources.checkbox00;
}
}
if (CheckedChangeEvent != null)
{
CheckedChangeEvent(this, null);
}
}
}
}
public new bool Enabled
{
get
{
return base.Enabled;
}
set
{
base.Enabled = value;
if (value)
{
if (_checked)
{
panel1.BackgroundImage = Properties.Resources.checkbox1;
}
else
{
panel1.BackgroundImage = Properties.Resources.checkbox0;
}
}
else
{
if (_checked)
{
panel1.BackgroundImage = Properties.Resources.checkbox10;
}
else
{
panel1.BackgroundImage = Properties.Resources.checkbox00;
}
}
}
}
public UCCheckBox()
{
InitializeComponent();
}
private void CheckBox_MouseDown(object sender, MouseEventArgs e)
{
Checked = !Checked;
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
[DefaultEvent("CheckedChangeEvent")]
public partial class UCCheckBox : UserControl
{
[Description("选中改变事件"), Category("自定义")]
public event EventHandler CheckedChangeEvent;
[Description("字体"), Category("自定义")]
public override Font Font
{
get
{
return base.Font;
}
set
{
base.Font = value;
label1.Font = value;
}
}
private Color _ForeColor = Color.FromArgb(62, 62, 62);
[Description("字体颜色"), Category("自定义")]
public new Color ForeColor
{
get { return _ForeColor; }
set
{
label1.ForeColor = value;
_ForeColor = value;
}
}
private string _Text = "复选框";
[Description("文本"), Category("自定义")]
public string TextValue
{
get { return _Text; }
set
{
label1.Text = value;
_Text = value;
}
}
private bool _checked = false;
[Description("是否选中"), Category("自定义")]
public bool Checked
{
get
{
return _checked;
}
set
{
if (_checked != value)
{
_checked = value;
if (base.Enabled)
{
if (_checked)
{
panel1.BackgroundImage = Properties.Resources.checkbox1;
}
else
{
panel1.BackgroundImage = Properties.Resources.checkbox0;
}
}
else
{
if (_checked)
{
panel1.BackgroundImage = Properties.Resources.checkbox10;
}
else
{
panel1.BackgroundImage = Properties.Resources.checkbox00;
}
}
if (CheckedChangeEvent != null)
{
CheckedChangeEvent(this, null);
}
}
}
}
public new bool Enabled
{
get
{
return base.Enabled;
}
set
{
base.Enabled = value;
if (value)
{
if (_checked)
{
panel1.BackgroundImage = Properties.Resources.checkbox1;
}
else
{
panel1.BackgroundImage = Properties.Resources.checkbox0;
}
}
else
{
if (_checked)
{
panel1.BackgroundImage = Properties.Resources.checkbox10;
}
else
{
panel1.BackgroundImage = Properties.Resources.checkbox00;
}
}
}
}
public UCCheckBox()
{
InitializeComponent();
}
private void CheckBox_MouseDown(object sender, MouseEventArgs e)
{
Checked = !Checked;
}
}
}
namespace HZH_Controls.Controls
{
partial class UCDataGridViewRow
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.ucSplitLine_H1 = new HZH_Controls.Controls.UCSplitLine_H();
this.panCells = new System.Windows.Forms.TableLayoutPanel();
this.SuspendLayout();
//
// ucSplitLine_H1
//
this.ucSplitLine_H1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(232)))), ((int)(((byte)(232)))));
this.ucSplitLine_H1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.ucSplitLine_H1.Location = new System.Drawing.Point(0, 55);
this.ucSplitLine_H1.Name = "ucSplitLine_H1";
this.ucSplitLine_H1.Size = new System.Drawing.Size(661, 1);
this.ucSplitLine_H1.TabIndex = 0;
this.ucSplitLine_H1.TabStop = false;
//
// panCells
//
this.panCells.ColumnCount = 1;
this.panCells.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.panCells.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.panCells.Dock = System.Windows.Forms.DockStyle.Fill;
this.panCells.Location = new System.Drawing.Point(0, 0);
this.panCells.Name = "panCells";
this.panCells.RowCount = 1;
this.panCells.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.panCells.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.panCells.Size = new System.Drawing.Size(661, 55);
this.panCells.TabIndex = 1;
//
// UCDataGridViewItem
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.White;
this.Controls.Add(this.panCells);
this.Controls.Add(this.ucSplitLine_H1);
this.Name = "UCDataGridViewItem";
this.Size = new System.Drawing.Size(661, 56);
this.ResumeLayout(false);
}
#endregion
private UCSplitLine_H ucSplitLine_H1;
private System.Windows.Forms.TableLayoutPanel panCells;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
public partial class UCDataGridViewRow : UserControl, IDataGridViewRow
{
#region 属性
public event DataGridViewCellEventHandler CheckBoxChangeEvent;
public event DataGridViewCellEventHandler CellClick;
public event DataGridViewCellEventHandler SourceChanged;
public List<DataGridViewColumnEntity> Columns
{
get;
set;
}
public object DataSource
{
get;
set;
}
public bool IsShowCheckBox
{
get;
set;
}
private bool m_isChecked;
public bool IsChecked
{
get
{
return m_isChecked;
}
set
{
if (m_isChecked != value)
{
m_isChecked = value;
(this.panCells.Controls.Find("check", false)[0] as UCCheckBox).Checked = value;
}
}
}
#endregion
public UCDataGridViewRow()
{
InitializeComponent();
}
public void BindingCellData()
{
for (int i = 0; i < Columns.Count; i++)
{
DataGridViewColumnEntity com = Columns[i];
var cs = this.panCells.Controls.Find("lbl_" + com.DataField, false);
if (cs != null && cs.Length > 0)
{
var pro = DataSource.GetType().GetProperty(com.DataField);
if (pro != null)
cs[0].Text = pro.GetValue(DataSource, null).ToStringExt();
}
}
}
void Item_MouseDown(object sender, MouseEventArgs e)
{
if (CellClick != null)
{
CellClick(sender, new DataGridViewCellEventArgs()
{
CellControl = this,
CellIndex = (sender as Control).Tag.ToInt()
});
}
}
public void SetSelect(bool blnSelected)
{
if (blnSelected)
{
this.BackColor = Color.FromArgb(255, 247, 245);
}
else
{
this.BackColor = Color.Transparent;
}
}
public void ReloadCells()
{
try
{
ControlHelper.FreezeControl(this, true);
this.panCells.Controls.Clear();
this.panCells.ColumnStyles.Clear();
int intColumnsCount = Columns.Count();
if (Columns != null && intColumnsCount > 0)
{
if (IsShowCheckBox)
{
intColumnsCount++;
}
this.panCells.ColumnCount = intColumnsCount;
for (int i = 0; i < intColumnsCount; i++)
{
Control c = null;
if (i == 0 && IsShowCheckBox)
{
this.panCells.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(SizeType.Absolute, 30F));
UCCheckBox box = new UCCheckBox();
box.Name = "check";
box.TextValue = "";
box.Size = new Size(30, 30);
box.Dock = DockStyle.Fill;
box.CheckedChangeEvent += (a, b) =>
{
IsChecked = box.Checked;
if (CheckBoxChangeEvent != null)
{
CheckBoxChangeEvent(a, new DataGridViewCellEventArgs()
{
CellControl = box,
CellIndex = 0
});
}
};
c = box;
}
else
{
var item = Columns[i - (IsShowCheckBox ? 1 : 0)];
this.panCells.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(item.WidthType, item.Width));
Label lbl = new Label();
lbl.Tag = i - (IsShowCheckBox ? 1 : 0);
lbl.Name = "lbl_" + item.DataField;
lbl.Font = new Font("微软雅黑", 12);
lbl.ForeColor = Color.Black;
lbl.AutoSize = false;
lbl.Dock = DockStyle.Fill;
lbl.TextAlign = ContentAlignment.MiddleCenter;
lbl.MouseDown += (a, b) =>
{
Item_MouseDown(a, b);
};
c = lbl;
}
this.panCells.Controls.Add(c, i, 0);
}
}
}
finally
{
ControlHelper.FreezeControl(this, false);
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HZH_Controls.Controls
{
public enum DateTimePickerType
{
DateTime = 1,
Date = 2,
Time = 4
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HZH_Controls.Controls
{
public enum DateTimePickerType
{
DateTime = 1,
Date = 2,
Time = 4
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
[DefaultEvent("KeyDown")]
public partial class UCKeyBorderAll : UserControl
{
private KeyBorderCharType _charType = KeyBorderCharType.CHAR;
[Description("默认显示样式"), Category("自定义")]
public KeyBorderCharType CharType
{
get { return _charType; }
set
{
_charType = value;
if (value == KeyBorderCharType.CHAR)
{
if (label37.Text.ToLower() == "abc.")
{
CharOrNum();
}
}
else
{
if (label37.Text.ToLower() == "?123")
{
CharOrNum();
}
}
}
}
[Description("按键点击事件"), Category("自定义")]
public event EventHandler KeyClick;
[Description("回车点击事件"), Category("自定义")]
public event EventHandler EnterClick;
[Description("删除点击事件"), Category("自定义")]
public event EventHandler BackspaceClike;
[Description("收起点击事件"), Category("自定义")]
public event EventHandler RetractClike;
public UCKeyBorderAll()
{
InitializeComponent();
}
private void KeyDown_MouseDown(object sender, MouseEventArgs e)
{
Label lbl = sender as Label;
if (string.IsNullOrEmpty(lbl.Text))
{
return;
}
if (lbl.Text == "大写")
{
ToUper(true);
lbl.Text = "小写";
}
else if (lbl.Text == "小写")
{
ToUper(false);
lbl.Text = "大写";
}
else if (lbl.Text == "?123" || lbl.Text == "abc.")
{
CharOrNum();
}
else if (lbl.Text == "空格")
{
SendKeys.Send(" ");
}
else if (lbl.Text == "删除")
{
SendKeys.Send("{BACKSPACE}");
if (BackspaceClike != null)
BackspaceClike(sender, e);
}
else if (lbl.Text == "回车")
{
SendKeys.Send("{ENTER}");
if (EnterClick != null)
EnterClick(sender, e);
}
else if (lbl.Text == "收起")
{
if (RetractClike != null)
RetractClike(sender, e);
}
else
{
SendKeys.Send(lbl.Text);
}
if (KeyClick != null)
KeyClick(sender, e);
}
private void ToUper(bool bln)
{
foreach (Control item in this.tableLayoutPanel2.Controls)
{
if (item is Panel)
{
foreach (Control pc in item.Controls)
{
if (pc is Label)
{
if (pc.Text == "abc.")
break;
if (bln)
{
pc.Text = pc.Text.ToUpper();
}
else
{
pc.Text = pc.Text.ToLower();
}
break;
}
}
}
}
}
private void CharOrNum()
{
foreach (Control item in this.tableLayoutPanel2.Controls)
{
if (item is Panel)
{
foreach (Control pc in item.Controls)
{
if (pc is Label)
{
string strTag = pc.Text;
pc.Text = pc.Tag.ToString();
pc.Tag = strTag;
break;
}
}
}
}
}
}
public enum KeyBorderCharType
{
CHAR = 1,
NUMBER = 2
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
[DefaultEvent("KeyDown")]
public partial class UCKeyBorderAll : UserControl
{
private KeyBorderCharType _charType = KeyBorderCharType.CHAR;
[Description("默认显示样式"), Category("自定义")]
public KeyBorderCharType CharType
{
get { return _charType; }
set
{
_charType = value;
if (value == KeyBorderCharType.CHAR)
{
if (label37.Text.ToLower() == "abc.")
{
CharOrNum();
}
}
else
{
if (label37.Text.ToLower() == "?123")
{
CharOrNum();
}
}
}
}
[Description("按键点击事件"), Category("自定义")]
public event EventHandler KeyClick;
[Description("回车点击事件"), Category("自定义")]
public event EventHandler EnterClick;
[Description("删除点击事件"), Category("自定义")]
public event EventHandler BackspaceClike;
[Description("收起点击事件"), Category("自定义")]
public event EventHandler RetractClike;
public UCKeyBorderAll()
{
InitializeComponent();
}
private void KeyDown_MouseDown(object sender, MouseEventArgs e)
{
Label lbl = sender as Label;
if (string.IsNullOrEmpty(lbl.Text))
{
return;
}
if (lbl.Text == "大写")
{
ToUper(true);
lbl.Text = "小写";
}
else if (lbl.Text == "小写")
{
ToUper(false);
lbl.Text = "大写";
}
else if (lbl.Text == "?123" || lbl.Text == "abc.")
{
CharOrNum();
}
else if (lbl.Text == "空格")
{
SendKeys.Send(" ");
}
else if (lbl.Text == "删除")
{
SendKeys.Send("{BACKSPACE}");
if (BackspaceClike != null)
BackspaceClike(sender, e);
}
else if (lbl.Text == "回车")
{
SendKeys.Send("{ENTER}");
if (EnterClick != null)
EnterClick(sender, e);
}
else if (lbl.Text == "收起")
{
if (RetractClike != null)
RetractClike(sender, e);
}
else
{
SendKeys.Send(lbl.Text);
}
if (KeyClick != null)
KeyClick(sender, e);
}
private void ToUper(bool bln)
{
foreach (Control item in this.tableLayoutPanel2.Controls)
{
if (item is Panel)
{
foreach (Control pc in item.Controls)
{
if (pc is Label)
{
if (pc.Text == "abc.")
break;
if (bln)
{
pc.Text = pc.Text.ToUpper();
}
else
{
pc.Text = pc.Text.ToLower();
}
break;
}
}
}
}
}
private void CharOrNum()
{
foreach (Control item in this.tableLayoutPanel2.Controls)
{
if (item is Panel)
{
foreach (Control pc in item.Controls)
{
if (pc is Label)
{
string strTag = pc.Text;
pc.Text = pc.Tag.ToString();
pc.Tag = strTag;
break;
}
}
}
}
}
}
public enum KeyBorderCharType
{
CHAR = 1,
NUMBER = 2
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
public partial class UCKeyBorderNum : UserControl
{
private bool useCustomEvent = false;
/// <summary>
/// 是否使用自定义的事件来接收按键,当为true时将不再向系统发送按键请求
/// </summary>
[Description("是否使用自定义的事件来接收按键,当为true时将不再向系统发送按键请求"), Category("自定义")]
public bool UseCustomEvent
{
get { return useCustomEvent; }
set { useCustomEvent = value; }
}
[Description("数字点击事件"),Category("自定义")]
public event EventHandler NumClick;
[Description("删除点击事件"), Category("自定义")]
public event EventHandler BackspaceClick;
[Description("回车点击事件"), Category("自定义")]
public event EventHandler EnterClick;
public UCKeyBorderNum()
{
InitializeComponent();
}
private void Num_MouseDown(object sender, MouseEventArgs e)
{
if (NumClick != null)
{
NumClick(sender, e);
}
if (useCustomEvent)
return;
Label lbl = sender as Label;
SendKeys.Send(lbl.Tag.ToString());
}
private void Backspace_MouseDown(object sender, MouseEventArgs e)
{
if (BackspaceClick != null)
{
BackspaceClick(sender, e);
}
if (useCustomEvent)
return;
Label lbl = sender as Label;
SendKeys.Send("{BACKSPACE}");
}
private void Enter_MouseDown(object sender, MouseEventArgs e)
{
if (EnterClick != null)
{
EnterClick(sender, e);
}
if (useCustomEvent)
return;
SendKeys.Send("{ENTER}");
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
public partial class UCKeyBorderNum : UserControl
{
private bool useCustomEvent = false;
/// <summary>
/// 是否使用自定义的事件来接收按键,当为true时将不再向系统发送按键请求
/// </summary>
[Description("是否使用自定义的事件来接收按键,当为true时将不再向系统发送按键请求"), Category("自定义")]
public bool UseCustomEvent
{
get { return useCustomEvent; }
set { useCustomEvent = value; }
}
[Description("数字点击事件"),Category("自定义")]
public event EventHandler NumClick;
[Description("删除点击事件"), Category("自定义")]
public event EventHandler BackspaceClick;
[Description("回车点击事件"), Category("自定义")]
public event EventHandler EnterClick;
public UCKeyBorderNum()
{
InitializeComponent();
}
private void Num_MouseDown(object sender, MouseEventArgs e)
{
if (NumClick != null)
{
NumClick(sender, e);
}
if (useCustomEvent)
return;
Label lbl = sender as Label;
SendKeys.Send(lbl.Tag.ToString());
}
private void Backspace_MouseDown(object sender, MouseEventArgs e)
{
if (BackspaceClick != null)
{
BackspaceClick(sender, e);
}
if (useCustomEvent)
return;
Label lbl = sender as Label;
SendKeys.Send("{BACKSPACE}");
}
private void Enter_MouseDown(object sender, MouseEventArgs e)
{
if (EnterClick != null)
{
EnterClick(sender, e);
}
if (useCustomEvent)
return;
SendKeys.Send("{ENTER}");
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HZH_Controls.Controls
{
public interface IPageControl
{
/// <summary>
/// 数据源改变时发生
/// </summary>
event PageControlEventHandler ShowChanged;
/// <summary>
/// 数据源
/// </summary>
List<object> DataSource { get; set; }
/// <summary>
/// 显示数量
/// </summary>
int PageSize { get; set; }
/// <summary>
/// 开始下标
/// </summary>
int StartIndex { get; set; }
/// <summary>
/// 第一页
/// </summary>
void FirstPage();
/// <summary>
/// 前一页
/// </summary>
void PreviousPage();
/// <summary>
/// 下一页
/// </summary>
void NextPage();
/// <summary>
/// 最后一页
/// </summary>
void EndPage();
/// <summary>
/// 重新加载
/// </summary>
void Reload();
/// <summary>
/// 获取当前页数据
/// </summary>
/// <returns></returns>
List<object> GetCurrentSource();
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace HZH_Controls.Controls
{
[Serializable]
[ComVisible(true)]
public delegate void PageControlEventHandler(object currentSource);
}
namespace HZH_Controls.Controls
{
partial class UCHorizontalList
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.panMain = new System.Windows.Forms.Panel();
this.panList = new System.Windows.Forms.Panel();
this.panRight = new System.Windows.Forms.Panel();
this.panLeft = new System.Windows.Forms.Panel();
this.panMain.SuspendLayout();
this.SuspendLayout();
//
// panMain
//
this.panMain.Controls.Add(this.panList);
this.panMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.panMain.Location = new System.Drawing.Point(46, 0);
this.panMain.Name = "panMain";
this.panMain.Size = new System.Drawing.Size(422, 53);
this.panMain.TabIndex = 3;
//
// panList
//
this.panList.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.panList.BackColor = System.Drawing.Color.Transparent;
this.panList.Location = new System.Drawing.Point(0, 0);
this.panList.Name = "panList";
this.panList.Size = new System.Drawing.Size(401, 53);
this.panList.TabIndex = 0;
//
// panRight
//
this.panRight.BackgroundImage = global::HZH_Controls.Properties.Resources.chevron_right;
this.panRight.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.panRight.Dock = System.Windows.Forms.DockStyle.Right;
this.panRight.Location = new System.Drawing.Point(468, 0);
this.panRight.Name = "panRight";
this.panRight.Size = new System.Drawing.Size(46, 53);
this.panRight.TabIndex = 2;
this.panRight.Visible = false;
this.panRight.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panRight_MouseDown);
//
// panLeft
//
this.panLeft.BackgroundImage = global::HZH_Controls.Properties.Resources.chevron_left;
this.panLeft.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.panLeft.Dock = System.Windows.Forms.DockStyle.Left;
this.panLeft.Location = new System.Drawing.Point(0, 0);
this.panLeft.Name = "panLeft";
this.panLeft.Size = new System.Drawing.Size(46, 53);
this.panLeft.TabIndex = 1;
this.panLeft.Visible = false;
this.panLeft.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panLeft_MouseDown);
//
// UCHorizontalList
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.panMain);
this.Controls.Add(this.panRight);
this.Controls.Add(this.panLeft);
this.Name = "UCHorizontalList";
this.Size = new System.Drawing.Size(514, 53);
this.panMain.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panLeft;
private System.Windows.Forms.Panel panRight;
private System.Windows.Forms.Panel panMain;
private System.Windows.Forms.Panel panList;
}
}
namespace HZH_Controls.Controls
{
partial class UCHorizontalList
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.panMain = new System.Windows.Forms.Panel();
this.panList = new System.Windows.Forms.Panel();
this.panRight = new System.Windows.Forms.Panel();
this.panLeft = new System.Windows.Forms.Panel();
this.panMain.SuspendLayout();
this.SuspendLayout();
//
// panMain
//
this.panMain.Controls.Add(this.panList);
this.panMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.panMain.Location = new System.Drawing.Point(46, 0);
this.panMain.Name = "panMain";
this.panMain.Size = new System.Drawing.Size(422, 53);
this.panMain.TabIndex = 3;
//
// panList
//
this.panList.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.panList.BackColor = System.Drawing.Color.Transparent;
this.panList.Location = new System.Drawing.Point(0, 0);
this.panList.Name = "panList";
this.panList.Size = new System.Drawing.Size(401, 53);
this.panList.TabIndex = 0;
//
// panRight
//
this.panRight.BackgroundImage = global::HZH_Controls.Properties.Resources.chevron_right;
this.panRight.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.panRight.Dock = System.Windows.Forms.DockStyle.Right;
this.panRight.Location = new System.Drawing.Point(468, 0);
this.panRight.Name = "panRight";
this.panRight.Size = new System.Drawing.Size(46, 53);
this.panRight.TabIndex = 2;
this.panRight.Visible = false;
this.panRight.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panRight_MouseDown);
//
// panLeft
//
this.panLeft.BackgroundImage = global::HZH_Controls.Properties.Resources.chevron_left;
this.panLeft.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.panLeft.Dock = System.Windows.Forms.DockStyle.Left;
this.panLeft.Location = new System.Drawing.Point(0, 0);
this.panLeft.Name = "panLeft";
this.panLeft.Size = new System.Drawing.Size(46, 53);
this.panLeft.TabIndex = 1;
this.panLeft.Visible = false;
this.panLeft.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panLeft_MouseDown);
//
// UCHorizontalList
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.panMain);
this.Controls.Add(this.panRight);
this.Controls.Add(this.panLeft);
this.Name = "UCHorizontalList";
this.Size = new System.Drawing.Size(514, 53);
this.panMain.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panLeft;
private System.Windows.Forms.Panel panRight;
private System.Windows.Forms.Panel panMain;
private System.Windows.Forms.Panel panList;
}
}
namespace HZH_Controls.Controls
{
partial class UCHorizontalListItem
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.lblTitle = new System.Windows.Forms.Label();
this.ucSplitLine_H1 = new HZH_Controls.Controls.UCSplitLine_H();
this.SuspendLayout();
//
// lblTitle
//
this.lblTitle.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblTitle.Font = new System.Drawing.Font("微软雅黑", 10F);
this.lblTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.lblTitle.Location = new System.Drawing.Point(1, 0);
this.lblTitle.Name = "lblTitle";
this.lblTitle.Padding = new System.Windows.Forms.Padding(0, 0, 0, 10);
this.lblTitle.Size = new System.Drawing.Size(118, 50);
this.lblTitle.TabIndex = 1;
this.lblTitle.Text = "分类名称\r\n分类名称";
this.lblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// ucSplitLine_H1
//
this.ucSplitLine_H1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.ucSplitLine_H1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.ucSplitLine_H1.Location = new System.Drawing.Point(1, 50);
this.ucSplitLine_H1.Name = "ucSplitLine_H1";
this.ucSplitLine_H1.Size = new System.Drawing.Size(118, 3);
this.ucSplitLine_H1.TabIndex = 0;
this.ucSplitLine_H1.TabStop = false;
//
// UCHorizontalListItem
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.lblTitle);
this.Controls.Add(this.ucSplitLine_H1);
this.Name = "UCHorizontalListItem";
this.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0);
this.Size = new System.Drawing.Size(120, 53);
this.ResumeLayout(false);
}
#endregion
private UCSplitLine_H ucSplitLine_H1;
private System.Windows.Forms.Label lblTitle;
}
}
namespace HZH_Controls.Controls
{
partial class UCHorizontalListItem
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.lblTitle = new System.Windows.Forms.Label();
this.ucSplitLine_H1 = new HZH_Controls.Controls.UCSplitLine_H();
this.SuspendLayout();
//
// lblTitle
//
this.lblTitle.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblTitle.Font = new System.Drawing.Font("微软雅黑", 10F);
this.lblTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.lblTitle.Location = new System.Drawing.Point(1, 0);
this.lblTitle.Name = "lblTitle";
this.lblTitle.Padding = new System.Windows.Forms.Padding(0, 0, 0, 10);
this.lblTitle.Size = new System.Drawing.Size(118, 50);
this.lblTitle.TabIndex = 1;
this.lblTitle.Text = "分类名称\r\n分类名称";
this.lblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// ucSplitLine_H1
//
this.ucSplitLine_H1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.ucSplitLine_H1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.ucSplitLine_H1.Location = new System.Drawing.Point(1, 50);
this.ucSplitLine_H1.Name = "ucSplitLine_H1";
this.ucSplitLine_H1.Size = new System.Drawing.Size(118, 3);
this.ucSplitLine_H1.TabIndex = 0;
this.ucSplitLine_H1.TabStop = false;
//
// UCHorizontalListItem
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.lblTitle);
this.Controls.Add(this.ucSplitLine_H1);
this.Name = "UCHorizontalListItem";
this.Padding = new System.Windows.Forms.Padding(1, 0, 1, 0);
this.Size = new System.Drawing.Size(120, 53);
this.ResumeLayout(false);
}
#endregion
private UCSplitLine_H ucSplitLine_H1;
private System.Windows.Forms.Label lblTitle;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
[ToolboxItem(false)]
public partial class UCHorizontalListItem : UserControl
{
public event EventHandler SelectedItem;
private KeyValuePair<string, string> _DataSource = new KeyValuePair<string, string>();
public KeyValuePair<string, string> DataSource
{
get { return _DataSource; }
set
{
_DataSource = value;
int intWidth = ControlHelper.GetStringWidth(value.Value, lblTitle.CreateGraphics(), lblTitle.Font);
if (intWidth < 50)
intWidth = 50;
this.Width = intWidth +20;
lblTitle.Text = value.Value;
SetSelect(false);
}
}
public UCHorizontalListItem()
{
InitializeComponent();
this.Dock = DockStyle.Right;
this.MouseDown += Item_MouseDown;
this.lblTitle.MouseDown += Item_MouseDown;
this.ucSplitLine_H1.MouseDown += Item_MouseDown;
}
void Item_MouseDown(object sender, MouseEventArgs e)
{
if (SelectedItem != null)
SelectedItem(this, e);
}
public void SetSelect(bool bln)
{
if (bln)
{
lblTitle.ForeColor = Color.FromArgb(255, 77, 59);
ucSplitLine_H1.Visible = true;
this.lblTitle.Padding = new Padding(0, 0, 0, 5);
}
else
{
lblTitle.ForeColor = Color.FromArgb(64,64,64);
ucSplitLine_H1.Visible = false;
this.lblTitle.Padding = new Padding(0, 0, 0, 0);
}
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
[ToolboxItem(false)]
public partial class UCHorizontalListItem : UserControl
{
public event EventHandler SelectedItem;
private KeyValuePair<string, string> _DataSource = new KeyValuePair<string, string>();
public KeyValuePair<string, string> DataSource
{
get { return _DataSource; }
set
{
_DataSource = value;
int intWidth = ControlHelper.GetStringWidth(value.Value, lblTitle.CreateGraphics(), lblTitle.Font);
if (intWidth < 50)
intWidth = 50;
this.Width = intWidth +20;
lblTitle.Text = value.Value;
SetSelect(false);
}
}
public UCHorizontalListItem()
{
InitializeComponent();
this.Dock = DockStyle.Right;
this.MouseDown += Item_MouseDown;
this.lblTitle.MouseDown += Item_MouseDown;
this.ucSplitLine_H1.MouseDown += Item_MouseDown;
}
void Item_MouseDown(object sender, MouseEventArgs e)
{
if (SelectedItem != null)
SelectedItem(this, e);
}
public void SetSelect(bool bln)
{
if (bln)
{
lblTitle.ForeColor = Color.FromArgb(255, 77, 59);
ucSplitLine_H1.Visible = true;
this.lblTitle.Padding = new Padding(0, 0, 0, 5);
}
else
{
lblTitle.ForeColor = Color.FromArgb(64,64,64);
ucSplitLine_H1.Visible = false;
this.lblTitle.Padding = new Padding(0, 0, 0, 0);
}
}
}
}
namespace HZH_Controls.Controls
{
partial class UCListExt
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// ListExt
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.AutoScroll = true;
this.Name = "ListExt";
this.Size = new System.Drawing.Size(336, 368);
this.ResumeLayout(false);
}
#endregion
}
}
namespace HZH_Controls.Controls
{
partial class UCListExt
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// ListExt
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.AutoScroll = true;
this.Name = "ListExt";
this.Size = new System.Drawing.Size(336, 368);
this.ResumeLayout(false);
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
[ToolboxItem(false)]
public partial class UCListItemExt : UserControl
{
[Description("标题"), Category("自定义")]
public string Title
{
get { return label1.Text; }
set { label1.Text = value; }
}
[Description("副标题"), Category("自定义")]
public string Title2
{
get { return label3.Text; }
set
{
label3.Text = value;
label3.Visible = !string.IsNullOrEmpty(value);
}
}
[Description("标题字体"), Category("自定义")]
public Font TitleFont
{
get { return label1.Font; }
set
{
label1.Font = value;
}
}
[Description("副标题字体"), Category("自定义")]
public Font Title2Font
{
get { return label3.Font; }
set
{
label3.Font = value;
}
}
[Description("背景色"), Category("自定义")]
public Color ItemBackColor
{
get { return this.BackColor; }
set
{
this.BackColor = value;
}
}
[Description("标题文本色"), Category("自定义")]
public Color ItemForeColor
{
get { return label1.ForeColor; }
set { label1.ForeColor = value; }
}
[Description("副标题文本色"), Category("自定义")]
public Color ItemForeColor2
{
get { return label3.ForeColor; }
set { label3.ForeColor = value; }
}
[Description("是否显示右侧更多箭头"), Category("自定义")]
public bool ShowMoreBtn
{
get { return label2.Visible; }
set { label2.Visible = value; ; }
}
[Description("项选中事件"), Category("自定义")]
public event EventHandler ItemClick;
/// <summary>
/// 数据源
/// </summary>
public ListEntity DataSource { get; private set; }
public UCListItemExt()
{
InitializeComponent();
SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
this.UpdateStyles();
}
private void item_MouseDown(object sender, MouseEventArgs e)
{
if (ItemClick != null)
{
ItemClick(this, e);
}
}
#region 设置数据
/// <summary>
/// 功能描述:设置数据
/// 作  者:HZH
/// 创建日期:2019-02-27 11:52:52
/// 任务编号:POS
/// </summary>
/// <param name="data">data</param>
public void SetData(ListEntity data)
{
this.Title = data.Title;
this.Title2 = data.Title2;
this.ShowMoreBtn = data.ShowMoreBtn;
DataSource = data;
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
[ToolboxItem(false)]
public partial class UCListItemExt : UserControl
{
[Description("标题"), Category("自定义")]
public string Title
{
get { return label1.Text; }
set { label1.Text = value; }
}
[Description("副标题"), Category("自定义")]
public string Title2
{
get { return label3.Text; }
set
{
label3.Text = value;
label3.Visible = !string.IsNullOrEmpty(value);
}
}
[Description("标题字体"), Category("自定义")]
public Font TitleFont
{
get { return label1.Font; }
set
{
label1.Font = value;
}
}
[Description("副标题字体"), Category("自定义")]
public Font Title2Font
{
get { return label3.Font; }
set
{
label3.Font = value;
}
}
[Description("背景色"), Category("自定义")]
public Color ItemBackColor
{
get { return this.BackColor; }
set
{
this.BackColor = value;
}
}
[Description("标题文本色"), Category("自定义")]
public Color ItemForeColor
{
get { return label1.ForeColor; }
set { label1.ForeColor = value; }
}
[Description("副标题文本色"), Category("自定义")]
public Color ItemForeColor2
{
get { return label3.ForeColor; }
set { label3.ForeColor = value; }
}
[Description("是否显示右侧更多箭头"), Category("自定义")]
public bool ShowMoreBtn
{
get { return label2.Visible; }
set { label2.Visible = value; ; }
}
[Description("项选中事件"), Category("自定义")]
public event EventHandler ItemClick;
/// <summary>
/// 数据源
/// </summary>
public ListEntity DataSource { get; private set; }
public UCListItemExt()
{
InitializeComponent();
SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
this.UpdateStyles();
}
private void item_MouseDown(object sender, MouseEventArgs e)
{
if (ItemClick != null)
{
ItemClick(this, e);
}
}
#region 设置数据
/// <summary>
/// 功能描述:设置数据
/// 作  者:HZH
/// 创建日期:2019-02-27 11:52:52
/// 任务编号:POS
/// </summary>
/// <param name="data">data</param>
public void SetData(ListEntity data)
{
this.Title = data.Title;
this.Title2 = data.Title2;
this.ShowMoreBtn = data.ShowMoreBtn;
DataSource = data;
}
#endregion
}
}
namespace HZH_Controls.Controls
{
partial class UCPagerControl
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.panel2 = new System.Windows.Forms.Panel();
this.panel1 = new System.Windows.Forms.Panel();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 2;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.Controls.Add(this.panel2, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.Padding = new System.Windows.Forms.Padding(3);
this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(304, 58);
this.tableLayoutPanel1.TabIndex = 0;
//
// panel2
//
this.panel2.BackgroundImage = global::HZH_Controls.Properties.Resources.rigth;
this.panel2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.panel2.Location = new System.Drawing.Point(155, 6);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(143, 46);
this.panel2.TabIndex = 1;
this.panel2.Visible = false;
this.panel2.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel2_MouseDown);
//
// panel1
//
this.panel1.BackgroundImage = global::HZH_Controls.Properties.Resources.left;
this.panel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.panel1.Location = new System.Drawing.Point(6, 6);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(143, 46);
this.panel1.TabIndex = 0;
this.panel1.Visible = false;
this.panel1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown);
//
// UCPagerControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.tableLayoutPanel1);
this.Name = "UCPagerControl";
this.Size = new System.Drawing.Size(304, 58);
this.tableLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel2;
}
}
namespace HZH_Controls.Controls.List
{
partial class UCPagerControl
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.panel4 = new System.Windows.Forms.Panel();
this.panel3 = new System.Windows.Forms.Panel();
this.panel2 = new System.Windows.Forms.Panel();
this.panel1 = new System.Windows.Forms.Panel();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 4;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel1.Controls.Add(this.panel4, 3, 0);
this.tableLayoutPanel1.Controls.Add(this.panel3, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.panel2, 2, 0);
this.tableLayoutPanel1.Controls.Add(this.panel1, 1, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.Padding = new System.Windows.Forms.Padding(3);
this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(304, 58);
this.tableLayoutPanel1.TabIndex = 1;
//
// panel4
//
this.panel4.BackgroundImage = global::HZH_Controls.Properties.Resources.end;
this.panel4.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.panel4.Location = new System.Drawing.Point(228, 6);
this.panel4.Name = "panel4";
this.panel4.Size = new System.Drawing.Size(68, 46);
this.panel4.TabIndex = 3;
this.panel4.Visible = false;
this.panel4.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel4_MouseDown);
//
// panel3
//
this.panel3.BackgroundImage = global::HZH_Controls.Properties.Resources.first;
this.panel3.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.panel3.Location = new System.Drawing.Point(6, 6);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(68, 46);
this.panel3.TabIndex = 2;
this.panel3.Visible = false;
this.panel3.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel3_MouseDown);
//
// panel2
//
this.panel2.BackgroundImage = global::HZH_Controls.Properties.Resources.right;
this.panel2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.panel2.Location = new System.Drawing.Point(154, 6);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(68, 46);
this.panel2.TabIndex = 1;
this.panel2.Visible = false;
this.panel2.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel2_MouseDown);
//
// panel1
//
this.panel1.BackgroundImage = global::HZH_Controls.Properties.Resources.left;
this.panel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.panel1.Location = new System.Drawing.Point(80, 6);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(68, 46);
this.panel1.TabIndex = 0;
this.panel1.Visible = false;
this.panel1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown);
//
// UCPagerControl
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.tableLayoutPanel1);
this.Name = "UCPagerControl";
this.tableLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Panel panel1;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
public partial class UCPagerControl : UserControl
{
public delegate void PageClickEvent(List<object> currentSource);
/// <summary>
/// 关联的数据源
/// </summary>
public List<object> Source { get; set; }
public event PageClickEvent LeftClick;
public event PageClickEvent RightClick;
public event PageClickEvent ShowChanged;
private int showCount = 1;
/// <summary>
/// 每页显示数量
/// </summary>
public int ShowCount
{
get { return showCount; }
set { showCount = value; }
}
private int startIndex = 0;
/// <summary>
/// 开始的下标
/// </summary>
public int StartIndex
{
get { return startIndex; }
set
{
startIndex = value;
if (startIndex <= 0)
startIndex = 0;
}
}
public UCPagerControl()
{
InitializeComponent();
}
public void NextPage()
{
if (startIndex + showCount >= Source.Count)
{
return;
}
startIndex += showCount;
if (startIndex < 0)
startIndex = 0;
var s = GetCurrentSoutce();
if (RightClick != null)
{
RightClick(s);
}
if (ShowChanged != null)
{
ShowChanged(s);
}
}
public void LastPage()
{
if (startIndex == 0)
return;
startIndex -= showCount;
if (startIndex < 0)
startIndex = 0;
var s = GetCurrentSoutce();
if (LeftClick != null)
{
LeftClick(s);
}
if (ShowChanged != null)
{
ShowChanged(s);
}
}
private void panel1_MouseDown(object sender, MouseEventArgs e)
{
LastPage();
}
private void panel2_MouseDown(object sender, MouseEventArgs e)
{
NextPage();
}
public void Reload()
{
var s = GetCurrentSoutce();
if (ShowChanged != null)
{
ShowChanged(s);
}
}
public List<object> GetCurrentSoutce()
{
int intShowCount = showCount;
if (intShowCount + startIndex > Source.Count)
intShowCount = Source.Count - startIndex;
object[] objs = new object[intShowCount];
Source.CopyTo(startIndex, objs, 0, intShowCount);
var lst = objs.ToList();
if (lst.Count > 0)
{
if (Source.IndexOf(lst[0]) > 0)
{
panel1.Visible = true;
}
else
{
panel1.Visible = false;
}
if (Source.IndexOf(lst[lst.Count - 1]) >= Source.Count - 1)
{
panel2.Visible = false;
}
else
{
panel2.Visible = true;
}
}
else
{
panel1.Visible = false;
panel2.Visible = false;
}
return lst;
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls.List
{
public partial class UCPagerControl : UCPagerControlBase
{
public UCPagerControl()
{
InitializeComponent();
}
private void panel1_MouseDown(object sender, MouseEventArgs e)
{
PreviousPage();
}
private void panel2_MouseDown(object sender, MouseEventArgs e)
{
NextPage();
}
private void panel3_MouseDown(object sender, MouseEventArgs e)
{
FirstPage();
}
private void panel4_MouseDown(object sender, MouseEventArgs e)
{
EndPage();
}
protected override void ShowBtn(bool blnLeftBtn, bool blnRightBtn)
{
panel1.Visible = panel3.Visible = blnLeftBtn;
panel2.Visible = panel4.Visible = blnRightBtn;
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
public class UCPagerControlBase : UserControl, IPageControl
{
#region 构造
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Name = "UCPagerControlBase";
this.Size = new System.Drawing.Size(304, 58);
this.ResumeLayout(false);
}
#endregion
#endregion
/// <summary>
/// 关联的数据源
/// </summary>
public List<object> DataSource { get; set; }
public event PageControlEventHandler ShowChanged;
private int m_pageSize = 1;
/// <summary>
/// 每页显示数量
/// </summary>
public int PageSize
{
get { return m_pageSize; }
set { m_pageSize = value; }
}
private int startIndex = 0;
/// <summary>
/// 开始的下标
/// </summary>
public int StartIndex
{
get { return startIndex; }
set
{
startIndex = value;
if (startIndex <= 0)
startIndex = 0;
}
}
public UCPagerControlBase()
{
InitializeComponent();
}
public void FirstPage()
{
startIndex = 0;
var s = GetCurrentSource();
if (ShowChanged != null)
{
ShowChanged(s);
}
}
public void PreviousPage()
{
if (startIndex == 0)
return;
startIndex -= m_pageSize;
if (startIndex < 0)
startIndex = 0;
var s = GetCurrentSource();
if (ShowChanged != null)
{
ShowChanged(s);
}
}
public void NextPage()
{
if (startIndex + m_pageSize >= DataSource.Count)
{
return;
}
startIndex += m_pageSize;
if (startIndex < 0)
startIndex = 0;
var s = GetCurrentSource();
if (ShowChanged != null)
{
ShowChanged(s);
}
}
public void EndPage()
{
startIndex = DataSource.Count - 1 - m_pageSize;
if (startIndex < 0)
startIndex = 0;
var s = GetCurrentSource();
if (ShowChanged != null)
{
ShowChanged(s);
}
}
public void Reload()
{
var s = GetCurrentSource();
if (ShowChanged != null)
{
ShowChanged(s);
}
}
public List<object> GetCurrentSource()
{
int intShowCount = m_pageSize;
if (intShowCount + startIndex > DataSource.Count)
intShowCount = DataSource.Count - startIndex;
object[] objs = new object[intShowCount];
DataSource.CopyTo(startIndex, objs, 0, intShowCount);
var lst = objs.ToList();
bool blnLeft = false;
bool blnRight = false;
if (lst.Count > 0)
{
if (DataSource.IndexOf(lst[0]) > 0)
{
blnLeft = true;
}
else
{
blnLeft = false;
}
if (DataSource.IndexOf(lst[lst.Count - 1]) >= DataSource.Count - 1)
{
blnRight = false;
}
else
{
blnRight = true;
}
}
ShowBtn(blnLeft, blnRight);
return lst;
}
/// <summary>
/// 控制按钮显示
/// </summary>
/// <param name="blnLeftBtn"></param>
/// <param name="blnRightBtn"></param>
protected virtual void ShowBtn(bool blnLeftBtn, bool blnRightBtn)
{ }
}
}
namespace HZH_Controls.Controls
{
partial class ProcessExt
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.panel1 = new System.Windows.Forms.Panel();
this.SuspendLayout();
//
// panel1
//
this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(23)))), ((int)(((byte)(127)))), ((int)(((byte)(203)))));
this.panel1.Dock = System.Windows.Forms.DockStyle.Left;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(0, 22);
this.panel1.TabIndex = 0;
//
// ProcessExt
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.White;
this.ConerRadius = 5;
this.Controls.Add(this.panel1);
this.IsRadius = true;
this.Name = "ProcessExt";
this.Size = new System.Drawing.Size(291, 22);
this.SizeChanged += new System.EventHandler(this.ProcessExt_SizeChanged);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
}
}
namespace HZH_Controls.Controls
{
partial class ProcessExt
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.panel1 = new System.Windows.Forms.Panel();
this.SuspendLayout();
//
// panel1
//
this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(23)))), ((int)(((byte)(127)))), ((int)(((byte)(203)))));
this.panel1.Dock = System.Windows.Forms.DockStyle.Left;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(0, 22);
this.panel1.TabIndex = 0;
//
// ProcessExt
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.White;
this.ConerRadius = 5;
this.Controls.Add(this.panel1);
this.IsRadius = true;
this.Name = "ProcessExt";
this.Size = new System.Drawing.Size(291, 22);
this.SizeChanged += new System.EventHandler(this.ProcessExt_SizeChanged);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
public partial class ProcessExt : UCControlBase
{
private int _value = 0;
public int Value
{
get { return this._value; }
set
{
if (value < 0)
return;
this._value = value;
SetValue();
}
}
private int maxValue = 100;
public int MaxValue
{
get { return maxValue; }
set
{
if (value <= 0)
return;
maxValue = value;
SetValue();
}
}
private void SetValue()
{
double dbl = (double)_value / (double)maxValue;
this.panel1.Width = (int)(this.Width * dbl);
}
public ProcessExt()
{
InitializeComponent();
}
private void ProcessExt_SizeChanged(object sender, EventArgs e)
{
SetValue();
}
public void Step()
{
Value++;
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
public partial class ProcessExt : UCControlBase
{
private int _value = 0;
public int Value
{
get { return this._value; }
set
{
if (value < 0)
return;
this._value = value;
SetValue();
}
}
private int maxValue = 100;
public int MaxValue
{
get { return maxValue; }
set
{
if (value <= 0)
return;
maxValue = value;
SetValue();
}
}
private void SetValue()
{
double dbl = (double)_value / (double)maxValue;
this.panel1.Width = (int)(this.Width * dbl);
}
public ProcessExt()
{
InitializeComponent();
}
private void ProcessExt_SizeChanged(object sender, EventArgs e)
{
SetValue();
}
public void Step()
{
Value++;
}
}
}
namespace HZH_Controls.Controls
{
partial class UCRadioButton
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel();
this.SuspendLayout();
//
// label1
//
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.Font = new System.Drawing.Font("微软雅黑", 12F);
this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(62)))), ((int)(((byte)(62)))), ((int)(((byte)(62)))));
this.label1.Location = new System.Drawing.Point(18, 0);
this.label1.Name = "label1";
this.label1.Padding = new System.Windows.Forms.Padding(5, 0, 0, 0);
this.label1.Size = new System.Drawing.Size(215, 30);
this.label1.TabIndex = 3;
this.label1.Text = "单选按钮";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Radio_MouseDown);
//
// panel1
//
this.panel1.BackgroundImage = global::HZH_Controls.Properties.Resources.radioButton0;
this.panel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.panel1.Dock = System.Windows.Forms.DockStyle.Left;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(18, 30);
this.panel1.TabIndex = 2;
this.panel1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Radio_MouseDown);
//
// UCRadioButton
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.label1);
this.Controls.Add(this.panel1);
this.Name = "UCRadioButton";
this.Size = new System.Drawing.Size(233, 30);
this.Load += new System.EventHandler(this.UCRadioButton_Load);
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Radio_MouseDown);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Panel panel1;
}
}
namespace HZH_Controls.Controls
{
partial class UCRadioButton
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel();
this.SuspendLayout();
//
// label1
//
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.Font = new System.Drawing.Font("微软雅黑", 12F);
this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(62)))), ((int)(((byte)(62)))), ((int)(((byte)(62)))));
this.label1.Location = new System.Drawing.Point(18, 0);
this.label1.Name = "label1";
this.label1.Padding = new System.Windows.Forms.Padding(5, 0, 0, 0);
this.label1.Size = new System.Drawing.Size(215, 30);
this.label1.TabIndex = 3;
this.label1.Text = "单选按钮";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Radio_MouseDown);
//
// panel1
//
this.panel1.BackgroundImage = global::HZH_Controls.Properties.Resources.radioButton0;
this.panel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.panel1.Dock = System.Windows.Forms.DockStyle.Left;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(18, 30);
this.panel1.TabIndex = 2;
this.panel1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Radio_MouseDown);
//
// UCRadioButton
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Controls.Add(this.label1);
this.Controls.Add(this.panel1);
this.Name = "UCRadioButton";
this.Size = new System.Drawing.Size(233, 30);
this.Load += new System.EventHandler(this.UCRadioButton_Load);
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Radio_MouseDown);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Panel panel1;
}
}
namespace HZH_Controls.Controls
{
partial class UCSplitLine_H
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// UCSplitLine_H
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(232)))), ((int)(((byte)(232)))));
this.Name = "UCSplitLine_H";
this.Size = new System.Drawing.Size(100, 1);
this.ResumeLayout(false);
}
#endregion
}
}
namespace HZH_Controls.Controls
{
partial class UCSplitLine_H
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// UCSplitLine_H
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(232)))), ((int)(((byte)(232)))));
this.Name = "UCSplitLine_H";
this.Size = new System.Drawing.Size(100, 1);
this.ResumeLayout(false);
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
public partial class UCSplitLine_H : UserControl
{
public UCSplitLine_H()
{
InitializeComponent();
this.TabStop = false;
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
public partial class UCSplitLine_H : UserControl
{
public UCSplitLine_H()
{
InitializeComponent();
this.TabStop = false;
}
}
}
namespace HZH_Controls.Controls
{
partial class UCSplitLine_V
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// UCSplitLine_V
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(232)))), ((int)(((byte)(232)))));
this.Name = "UCSplitLine_V";
this.Size = new System.Drawing.Size(1, 100);
this.ResumeLayout(false);
}
#endregion
}
}
namespace HZH_Controls.Controls
{
partial class UCSplitLine_V
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// UCSplitLine_V
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(232)))), ((int)(((byte)(232)))));
this.Name = "UCSplitLine_V";
this.Size = new System.Drawing.Size(1, 100);
this.ResumeLayout(false);
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
public partial class UCSplitLine_V : UserControl
{
public UCSplitLine_V()
{
InitializeComponent();
this.TabStop = false;
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
public partial class UCSplitLine_V : UserControl
{
public UCSplitLine_V()
{
InitializeComponent();
this.TabStop = false;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HZH_Controls.Controls
{
public enum KeyBoardType
{
Null = 1,
UCKeyBorderAll_EN = 2,
UCKeyBorderAll_Num = 4,
UCKeyBorderNum = 8,
UCKeyBorderHand = 16
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HZH_Controls.Controls
{
public enum KeyBoardType
{
Null = 1,
UCKeyBorderAll_EN = 2,
UCKeyBorderAll_Num = 4,
UCKeyBorderNum = 8,
UCKeyBorderHand = 16
}
}
namespace HZH_Controls.Controls
{
partial class TextBoxEx
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
#endregion
}
}
namespace HZH_Controls.Controls
{
partial class TextBoxEx
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace HZH_Controls.Controls
{
public class win32
{
public const int WM_MOUSEMOVE = 0x0200;
public const int WM_LBUTTONDOWN = 0x0201;
public const int WM_LBUTTONUP = 0x0202;
public const int WM_RBUTTONDOWN = 0x0204;
public const int WM_LBUTTONDBLCLK = 0x0203;
public const int WM_MOUSELEAVE = 0x02A3;
public const int WM_PAINT = 0x000F;
public const int WM_ERASEBKGND = 0x0014;
public const int WM_PRINT = 0x0317;
//const int EN_HSCROLL = 0x0601;
//const int EN_VSCROLL = 0x0602;
public const int WM_HSCROLL = 0x0114;
public const int WM_VSCROLL = 0x0115;
public const int EM_GETSEL = 0x00B0;
public const int EM_LINEINDEX = 0x00BB;
public const int EM_LINEFROMCHAR = 0x00C9;
public const int EM_POSFROMCHAR = 0x00D6;
[DllImport("USER32.DLL", EntryPoint = "PostMessage")]
public static extern bool PostMessage(IntPtr hwnd, uint msg,
IntPtr wParam, IntPtr lParam);
/*
BOOL PostMessage( HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam
);
*/
// Put this declaration in your class //IntPtr
[DllImport("USER32.DLL", EntryPoint = "SendMessage")]
public static extern int SendMessage(IntPtr hwnd, int msg, IntPtr wParam,
IntPtr lParam);
[DllImport("USER32.DLL", EntryPoint = "GetCaretBlinkTime")]
public static extern uint GetCaretBlinkTime();
const int WM_PRINTCLIENT = 0x0318;
const long PRF_CHECKVISIBLE = 0x00000001L;
const long PRF_NONCLIENT = 0x00000002L;
const long PRF_CLIENT = 0x00000004L;
const long PRF_ERASEBKGND = 0x00000008L;
const long PRF_CHILDREN = 0x00000010L;
const long PRF_OWNED = 0x00000020L;
/* Will clean this up later doing something like this
enum CaptureOptions : long
{
PRF_CHECKVISIBLE= 0x00000001L,
PRF_NONCLIENT = 0x00000002L,
PRF_CLIENT = 0x00000004L,
PRF_ERASEBKGND = 0x00000008L,
PRF_CHILDREN = 0x00000010L,
PRF_OWNED = 0x00000020L
}
*/
public static bool CaptureWindow(System.Windows.Forms.Control control,
ref System.Drawing.Bitmap bitmap)
{
//This function captures the contents of a window or control
Graphics g2 = Graphics.FromImage(bitmap);
//PRF_CHILDREN // PRF_NONCLIENT
int meint = (int)(PRF_CLIENT | PRF_ERASEBKGND); //| PRF_OWNED ); // );
System.IntPtr meptr = new System.IntPtr(meint);
System.IntPtr hdc = g2.GetHdc();
win32.SendMessage(control.Handle, win32.WM_PRINT, hdc, meptr);
g2.ReleaseHdc(hdc);
g2.Dispose();
return true;
}
}
}
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace HZH_Controls.Controls
{
public class win32
{
public const int WM_MOUSEMOVE = 0x0200;
public const int WM_LBUTTONDOWN = 0x0201;
public const int WM_LBUTTONUP = 0x0202;
public const int WM_RBUTTONDOWN = 0x0204;
public const int WM_LBUTTONDBLCLK = 0x0203;
public const int WM_MOUSELEAVE = 0x02A3;
public const int WM_PAINT = 0x000F;
public const int WM_ERASEBKGND = 0x0014;
public const int WM_PRINT = 0x0317;
//const int EN_HSCROLL = 0x0601;
//const int EN_VSCROLL = 0x0602;
public const int WM_HSCROLL = 0x0114;
public const int WM_VSCROLL = 0x0115;
public const int EM_GETSEL = 0x00B0;
public const int EM_LINEINDEX = 0x00BB;
public const int EM_LINEFROMCHAR = 0x00C9;
public const int EM_POSFROMCHAR = 0x00D6;
[DllImport("USER32.DLL", EntryPoint = "PostMessage")]
public static extern bool PostMessage(IntPtr hwnd, uint msg,
IntPtr wParam, IntPtr lParam);
/*
BOOL PostMessage( HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam
);
*/
// Put this declaration in your class //IntPtr
[DllImport("USER32.DLL", EntryPoint = "SendMessage")]
public static extern int SendMessage(IntPtr hwnd, int msg, IntPtr wParam,
IntPtr lParam);
[DllImport("USER32.DLL", EntryPoint = "GetCaretBlinkTime")]
public static extern uint GetCaretBlinkTime();
const int WM_PRINTCLIENT = 0x0318;
const long PRF_CHECKVISIBLE = 0x00000001L;
const long PRF_NONCLIENT = 0x00000002L;
const long PRF_CLIENT = 0x00000004L;
const long PRF_ERASEBKGND = 0x00000008L;
const long PRF_CHILDREN = 0x00000010L;
const long PRF_OWNED = 0x00000020L;
/* Will clean this up later doing something like this
enum CaptureOptions : long
{
PRF_CHECKVISIBLE= 0x00000001L,
PRF_NONCLIENT = 0x00000002L,
PRF_CLIENT = 0x00000004L,
PRF_ERASEBKGND = 0x00000008L,
PRF_CHILDREN = 0x00000010L,
PRF_OWNED = 0x00000020L
}
*/
public static bool CaptureWindow(System.Windows.Forms.Control control,
ref System.Drawing.Bitmap bitmap)
{
//This function captures the contents of a window or control
Graphics g2 = Graphics.FromImage(bitmap);
//PRF_CHILDREN // PRF_NONCLIENT
int meint = (int)(PRF_CLIENT | PRF_ERASEBKGND); //| PRF_OWNED ); // );
System.IntPtr meptr = new System.IntPtr(meint);
System.IntPtr hdc = g2.GetHdc();
win32.SendMessage(control.Handle, win32.WM_PRINT, hdc, meptr);
g2.ReleaseHdc(hdc);
g2.Dispose();
return true;
}
}
}
using System.Drawing;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
partial class UCControlBase
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
base.SuspendLayout();
base.AutoScaleDimensions = new SizeF(9f, 20f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.DoubleBuffered = true;
this.Font = new Font("微软雅黑", 15f, FontStyle.Regular, GraphicsUnit.Pixel);
base.Margin = new Padding(4, 5, 4, 5);
base.Name = "UCBase";
base.Size = new Size(237, 154);
base.ResumeLayout(false);
}
#endregion
}
}
using System.Drawing;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
partial class UCControlBase
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
base.SuspendLayout();
base.AutoScaleDimensions = new SizeF(9f, 20f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.DoubleBuffered = true;
this.Font = new Font("微软雅黑", 15f, FontStyle.Regular, GraphicsUnit.Pixel);
base.Margin = new Padding(4, 5, 4, 5);
base.Name = "UCBase";
base.Size = new Size(237, 154);
base.ResumeLayout(false);
}
#endregion
}
}
namespace HZH_Controls.Forms
{
partial class FrmAnchor
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmAnchor));
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.SuspendLayout();
//
// timer1
//
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// FrmAnchor
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(45, 48);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "FrmAnchor";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Text = "FrmAnchor";
this.TopMost = true;
this.Load += new System.EventHandler(this.FrmAnchor_Load);
this.VisibleChanged += new System.EventHandler(this.FrmAnchor_VisibleChanged);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Timer timer1;
}
namespace HZH_Controls.Forms
{
partial class FrmAnchor
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmAnchor));
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.SuspendLayout();
//
// timer1
//
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// FrmAnchor
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(45, 48);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "FrmAnchor";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Text = "FrmAnchor";
this.TopMost = true;
this.Load += new System.EventHandler(this.FrmAnchor_Load);
this.VisibleChanged += new System.EventHandler(this.FrmAnchor_VisibleChanged);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Timer timer1;
}
}
\ No newline at end of file

1.1 KB | 宽: | 高:

582 字节 | 宽: | 高:

HZH_Controls/HZH_Controls/Resources/left.png
HZH_Controls/HZH_Controls/Resources/left.png
HZH_Controls/HZH_Controls/Resources/left.png
HZH_Controls/HZH_Controls/Resources/left.png
  • 两方对比
  • 交换覆盖
  • 透明覆盖
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!