mirror of
https://github.com/eggplantlwj/VisionEdit.git
synced 2026-03-24 16:56:36 +08:00
1、优化LOG显示与引用
2、添加PMA工具,工具内容待完善 3、修复流程树显示 4、添加开源项目,优化UI空间 5、其他BUG更改
This commit is contained in:
2467
UsingControl/HZHControls/Controls/KeyBord/UCKeyBorderAll.Designer.cs
generated
Normal file
2467
UsingControl/HZHControls/Controls/KeyBord/UCKeyBorderAll.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
219
UsingControl/HZHControls/Controls/KeyBord/UCKeyBorderAll.cs
Normal file
219
UsingControl/HZHControls/Controls/KeyBord/UCKeyBorderAll.cs
Normal file
@@ -0,0 +1,219 @@
|
||||
// ***********************************************************************
|
||||
// Assembly : HZH_Controls
|
||||
// Created : 08-08-2019
|
||||
//
|
||||
// ***********************************************************************
|
||||
// <copyright file="UCKeyBorderAll.cs">
|
||||
// Copyright by Huang Zhenghui(黄正辉) All, QQ group:568015492 QQ:623128629 Email:623128629@qq.com
|
||||
// </copyright>
|
||||
//
|
||||
// Blog: https://www.cnblogs.com/bfyx
|
||||
// GitHub:https://github.com/kwwwvagaa/NetWinformControl
|
||||
// gitee:https://gitee.com/kwwwvagaa/net_winform_custom_control.git
|
||||
//
|
||||
// If you use this code, please keep this note.
|
||||
// ***********************************************************************
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace HZH_Controls.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// Class UCKeyBorderAll.
|
||||
/// Implements the <see cref="System.Windows.Forms.UserControl" />
|
||||
/// </summary>
|
||||
/// <seealso cref="System.Windows.Forms.UserControl" />
|
||||
[DefaultEvent("KeyDown")]
|
||||
public partial class UCKeyBorderAll : UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// The character type
|
||||
/// </summary>
|
||||
private KeyBorderCharType _charType = KeyBorderCharType.CHAR;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type of the character.
|
||||
/// </summary>
|
||||
/// <value>The type of the character.</value>
|
||||
[Description("默认显示样式"), Category("自定义")]
|
||||
public KeyBorderCharType CharType
|
||||
{
|
||||
get { return _charType; }
|
||||
set
|
||||
{
|
||||
_charType = value;
|
||||
if (value == KeyBorderCharType.CHAR)
|
||||
{
|
||||
if (label37.Text.ToLower() == "abc.")
|
||||
{
|
||||
CharOrNum();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (label37.Text.ToLower() == "?123")
|
||||
{
|
||||
CharOrNum();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Occurs when [key click].
|
||||
/// </summary>
|
||||
[Description("按键点击事件"), Category("自定义")]
|
||||
public event EventHandler KeyClick;
|
||||
/// <summary>
|
||||
/// Occurs when [enter click].
|
||||
/// </summary>
|
||||
[Description("回车点击事件"), Category("自定义")]
|
||||
public event EventHandler EnterClick;
|
||||
/// <summary>
|
||||
/// Occurs when [backspace clike].
|
||||
/// </summary>
|
||||
[Description("删除点击事件"), Category("自定义")]
|
||||
public event EventHandler BackspaceClike;
|
||||
/// <summary>
|
||||
/// Occurs when [retract clike].
|
||||
/// </summary>
|
||||
[Description("收起点击事件"), Category("自定义")]
|
||||
public event EventHandler RetractClike;
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UCKeyBorderAll" /> class.
|
||||
/// </summary>
|
||||
public UCKeyBorderAll()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles the MouseDown event of the KeyDown control.
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
|
||||
private void KeyDown_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
Label lbl = sender as Label;
|
||||
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
|
||||
{
|
||||
string Str = "{"+ lbl.Text + "}";
|
||||
SendKeys.Send(lbl.Text);
|
||||
}
|
||||
if (KeyClick != null)
|
||||
KeyClick(sender, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts to uper.
|
||||
/// </summary>
|
||||
/// <param name="bln">if set to <c>true</c> [BLN].</param>
|
||||
private void ToUper(bool bln)
|
||||
{
|
||||
foreach (Control item in this.tableLayoutPanel2.Controls)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Characters the or number.
|
||||
/// </summary>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Enum KeyBorderCharType
|
||||
/// </summary>
|
||||
public enum KeyBorderCharType
|
||||
{
|
||||
/// <summary>
|
||||
/// The character
|
||||
/// </summary>
|
||||
CHAR = 1,
|
||||
/// <summary>
|
||||
/// The number
|
||||
/// </summary>
|
||||
NUMBER = 2
|
||||
}
|
||||
}
|
||||
120
UsingControl/HZHControls/Controls/KeyBord/UCKeyBorderAll.resx
Normal file
120
UsingControl/HZHControls/Controls/KeyBord/UCKeyBorderAll.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
1074
UsingControl/HZHControls/Controls/KeyBord/UCKeyBorderNum.Designer.cs
generated
Normal file
1074
UsingControl/HZHControls/Controls/KeyBord/UCKeyBorderNum.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
121
UsingControl/HZHControls/Controls/KeyBord/UCKeyBorderNum.cs
Normal file
121
UsingControl/HZHControls/Controls/KeyBord/UCKeyBorderNum.cs
Normal file
@@ -0,0 +1,121 @@
|
||||
// ***********************************************************************
|
||||
// Assembly : HZH_Controls
|
||||
// Created : 08-08-2019
|
||||
//
|
||||
// ***********************************************************************
|
||||
// <copyright file="UCKeyBorderNum.cs">
|
||||
// Copyright by Huang Zhenghui(黄正辉) All, QQ group:568015492 QQ:623128629 Email:623128629@qq.com
|
||||
// </copyright>
|
||||
//
|
||||
// Blog: https://www.cnblogs.com/bfyx
|
||||
// GitHub:https://github.com/kwwwvagaa/NetWinformControl
|
||||
// gitee:https://gitee.com/kwwwvagaa/net_winform_custom_control.git
|
||||
//
|
||||
// If you use this code, please keep this note.
|
||||
// ***********************************************************************
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace HZH_Controls.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// Class UCKeyBorderNum.
|
||||
/// Implements the <see cref="System.Windows.Forms.UserControl" />
|
||||
/// </summary>
|
||||
/// <seealso cref="System.Windows.Forms.UserControl" />
|
||||
public partial class UCKeyBorderNum : UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// The use custom event
|
||||
/// </summary>
|
||||
private bool useCustomEvent = false;
|
||||
/// <summary>
|
||||
/// 是否使用自定义的事件来接收按键,当为true时将不再向系统发送按键请求
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if [use custom event]; otherwise, <c>false</c>.</value>
|
||||
[Description("是否使用自定义的事件来接收按键,当为true时将不再向系统发送按键请求"), Category("自定义")]
|
||||
public bool UseCustomEvent
|
||||
{
|
||||
get { return useCustomEvent; }
|
||||
set { useCustomEvent = value; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Occurs when [number click].
|
||||
/// </summary>
|
||||
[Description("数字点击事件"), Category("自定义")]
|
||||
public event EventHandler NumClick;
|
||||
/// <summary>
|
||||
/// Occurs when [backspace click].
|
||||
/// </summary>
|
||||
[Description("删除点击事件"), Category("自定义")]
|
||||
public event EventHandler BackspaceClick;
|
||||
/// <summary>
|
||||
/// Occurs when [enter click].
|
||||
/// </summary>
|
||||
[Description("回车点击事件"), Category("自定义")]
|
||||
public event EventHandler EnterClick;
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UCKeyBorderNum" /> class.
|
||||
/// </summary>
|
||||
public UCKeyBorderNum()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles the MouseDown event of the Num control.
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
|
||||
private void Num_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (NumClick != null)
|
||||
{
|
||||
NumClick(sender, e);
|
||||
}
|
||||
if (useCustomEvent)
|
||||
return;
|
||||
Label lbl = sender as Label;
|
||||
SendKeys.Send(lbl.Tag.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles the MouseDown event of the Backspace control.
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
|
||||
private void Backspace_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (BackspaceClick != null)
|
||||
{
|
||||
BackspaceClick(sender, e);
|
||||
}
|
||||
if (useCustomEvent)
|
||||
return;
|
||||
Label lbl = sender as Label;
|
||||
SendKeys.Send("{BACKSPACE}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles the MouseDown event of the Enter control.
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
|
||||
private void Enter_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (EnterClick != null)
|
||||
{
|
||||
EnterClick(sender, e);
|
||||
}
|
||||
if (useCustomEvent)
|
||||
return;
|
||||
SendKeys.Send("{ENTER}");
|
||||
}
|
||||
}
|
||||
}
|
||||
120
UsingControl/HZHControls/Controls/KeyBord/UCKeyBorderNum.resx
Normal file
120
UsingControl/HZHControls/Controls/KeyBord/UCKeyBorderNum.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
1359
UsingControl/HZHControls/Controls/KeyBord/UCKeyBorderPay.Designer.cs
generated
Normal file
1359
UsingControl/HZHControls/Controls/KeyBord/UCKeyBorderPay.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
306
UsingControl/HZHControls/Controls/KeyBord/UCKeyBorderPay.cs
Normal file
306
UsingControl/HZHControls/Controls/KeyBord/UCKeyBorderPay.cs
Normal file
@@ -0,0 +1,306 @@
|
||||
// ***********************************************************************
|
||||
// Assembly : HZH_Controls
|
||||
// Created : 08-08-2019
|
||||
//
|
||||
// ***********************************************************************
|
||||
// <copyright file="UCKeyBorderPay.cs">
|
||||
// Copyright by Huang Zhenghui(黄正辉) All, QQ group:568015492 QQ:623128629 Email:623128629@qq.com
|
||||
// </copyright>
|
||||
//
|
||||
// Blog: https://www.cnblogs.com/bfyx
|
||||
// GitHub:https://github.com/kwwwvagaa/NetWinformControl
|
||||
// gitee:https://gitee.com/kwwwvagaa/net_winform_custom_control.git
|
||||
//
|
||||
// If you use this code, please keep this note.
|
||||
// ***********************************************************************
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace HZH_Controls.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// Class UCKeyBorderPay.
|
||||
/// Implements the <see cref="System.Windows.Forms.UserControl" />
|
||||
/// </summary>
|
||||
/// <seealso cref="System.Windows.Forms.UserControl" />
|
||||
public partial class UCKeyBorderPay : UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Occurs when [number click].
|
||||
/// </summary>
|
||||
[Description("数字点击事件"), Category("自定义")]
|
||||
public event EventHandler NumClick;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when [cancel click].
|
||||
/// </summary>
|
||||
[Description("取消点击事件"), Category("自定义")]
|
||||
public event EventHandler CancelClick;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when [ok click].
|
||||
/// </summary>
|
||||
[Description("确定点击事件"), Category("自定义")]
|
||||
public event EventHandler OKClick;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when [backspace click].
|
||||
/// </summary>
|
||||
[Description("删除点击事件"), Category("自定义")]
|
||||
public event EventHandler BackspaceClick;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when [money click].
|
||||
/// </summary>
|
||||
[Description("金额点击事件"), Category("自定义")]
|
||||
public event EventHandler MoneyClick;
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UCKeyBorderPay" /> class.
|
||||
/// </summary>
|
||||
public UCKeyBorderPay()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
#region 设置快速付款金额
|
||||
/// <summary>
|
||||
/// 功能描述:设置快速付款金额
|
||||
/// 作 者:HZH
|
||||
/// 创建日期:2019-03-07 11:41:04
|
||||
/// 任务编号:POS
|
||||
/// </summary>
|
||||
/// <param name="SorceMoney">SorceMoney</param>
|
||||
public void SetPayMoney(decimal SorceMoney)
|
||||
{
|
||||
List<decimal> list = new List<decimal>();
|
||||
decimal d = Math.Ceiling(SorceMoney);
|
||||
if (SorceMoney > 0m)
|
||||
{
|
||||
if (SorceMoney < 5m)
|
||||
{
|
||||
list.Add(5m);
|
||||
list.Add(10m);
|
||||
list.Add(20m);
|
||||
list.Add(50m);
|
||||
}
|
||||
else if (SorceMoney < 10m)
|
||||
{
|
||||
list.Add(10m);
|
||||
list.Add(20m);
|
||||
list.Add(50m);
|
||||
list.Add(100m);
|
||||
}
|
||||
else
|
||||
{
|
||||
int num = Convert.ToInt32(d % 10m);
|
||||
int num2 = Convert.ToInt32(Math.Floor(d / 10m) % 10m);
|
||||
int num3 = Convert.ToInt32(Math.Floor(d / 100m));
|
||||
int num4;
|
||||
if (num < 5)
|
||||
{
|
||||
num4 = num2 * 10 + 5;
|
||||
list.Add(num4 + num3 * 100);
|
||||
num4 = (num2 + 1) * 10;
|
||||
list.Add(num4 + num3 * 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
num4 = (num2 + 1) * 10;
|
||||
list.Add(num4 + num3 * 100);
|
||||
}
|
||||
if (num4 >= 0 && num4 < 10)
|
||||
{
|
||||
num4 = 10;
|
||||
if (list.Count < 4)
|
||||
{
|
||||
list.Add(num4 + num3 * 100);
|
||||
}
|
||||
num4 = 20;
|
||||
if (list.Count < 4)
|
||||
{
|
||||
list.Add(num4 + num3 * 100);
|
||||
}
|
||||
num4 = 50;
|
||||
if (list.Count < 4)
|
||||
{
|
||||
list.Add(num4 + num3 * 100);
|
||||
}
|
||||
num4 = 100;
|
||||
if (list.Count < 4)
|
||||
{
|
||||
list.Add(num4 + num3 * 100);
|
||||
}
|
||||
}
|
||||
else if (num4 >= 10 && num4 < 20)
|
||||
{
|
||||
num4 = 20;
|
||||
if (list.Count < 4)
|
||||
{
|
||||
list.Add(num4 + num3 * 100);
|
||||
}
|
||||
num4 = 50;
|
||||
if (list.Count < 4)
|
||||
{
|
||||
list.Add(num4 + num3 * 100);
|
||||
}
|
||||
num4 = 100;
|
||||
if (list.Count < 4)
|
||||
{
|
||||
list.Add(num4 + num3 * 100);
|
||||
}
|
||||
}
|
||||
else if (num4 >= 20 && num4 < 50)
|
||||
{
|
||||
num4 = 50;
|
||||
if (list.Count < 4)
|
||||
{
|
||||
list.Add(num4 + num3 * 100);
|
||||
}
|
||||
num4 = 100;
|
||||
if (list.Count < 4)
|
||||
{
|
||||
list.Add(num4 + num3 * 100);
|
||||
}
|
||||
}
|
||||
else if (num4 < 100)
|
||||
{
|
||||
num4 = 100;
|
||||
if (list.Count < 4)
|
||||
{
|
||||
list.Add(num4 + num3 * 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
SetFastMoneyToContrl(list);
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Sets the fast money to contrl.
|
||||
/// </summary>
|
||||
/// <param name="values">The values.</param>
|
||||
private void SetFastMoneyToContrl(List<decimal> values)
|
||||
{
|
||||
List<Label> lbl = new List<Label>() { lblFast1, lblFast2, lblFast3, lblFast4 };
|
||||
lblFast1.Tag = lblFast1.Text = "";
|
||||
lblFast2.Tag = lblFast2.Text = "";
|
||||
lblFast3.Tag = lblFast3.Text = "";
|
||||
lblFast4.Tag = lblFast4.Text = "";
|
||||
for (int i = 0; i < lbl.Count && i < values.Count; i++)
|
||||
{
|
||||
if (values[i].ToString("0.##").Length < 4)
|
||||
{
|
||||
lbl[i].Font = new System.Drawing.Font("Arial Unicode MS", 30F);
|
||||
}
|
||||
else
|
||||
{
|
||||
Graphics graphics = lbl[i].CreateGraphics();
|
||||
for (int j = 0; j < 5; j++)
|
||||
{
|
||||
SizeF sizeF = graphics.MeasureString(values[i].ToString("0.##"), new System.Drawing.Font("Arial Unicode MS", 30 - j * 5), 100, StringFormat.GenericTypographic);
|
||||
if (sizeF.Width <= lbl[i].Width - 20)
|
||||
{
|
||||
lbl[i].Font = new System.Drawing.Font("Arial Unicode MS", 30 - j * 5);
|
||||
break;
|
||||
}
|
||||
}
|
||||
graphics.Dispose();
|
||||
}
|
||||
lbl[i].Tag = lbl[i].Text = values[i].ToString("0.##");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Handles the MouseDown event of the Num control.
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
|
||||
private void Num_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (NumClick != null)
|
||||
NumClick((sender as Label).Tag, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles the MouseDown event of the Backspace control.
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
|
||||
private void Backspace_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (BackspaceClick != null)
|
||||
BackspaceClick((sender as Label).Tag, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles the MouseDown event of the Cancel control.
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
|
||||
private void Cancel_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (CancelClick != null)
|
||||
CancelClick((sender as Label).Tag, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles the MouseDown event of the OK control.
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
|
||||
private void OK_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (OKClick != null)
|
||||
OKClick((sender as Label).Tag, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles the MouseDown event of the Money control.
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
|
||||
private void Money_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (MoneyClick != null)
|
||||
MoneyClick((sender as Label).Tag, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Money1s the click.
|
||||
/// </summary>
|
||||
public void Money1Click()
|
||||
{
|
||||
Money_MouseDown(lblFast1, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Money2s the click.
|
||||
/// </summary>
|
||||
public void Money2Click()
|
||||
{
|
||||
Money_MouseDown(lblFast2, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Money3s the click.
|
||||
/// </summary>
|
||||
public void Money3Click()
|
||||
{
|
||||
Money_MouseDown(lblFast3, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Money4s the click.
|
||||
/// </summary>
|
||||
public void Money4Click()
|
||||
{
|
||||
Money_MouseDown(lblFast4, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
120
UsingControl/HZHControls/Controls/KeyBord/UCKeyBorderPay.resx
Normal file
120
UsingControl/HZHControls/Controls/KeyBord/UCKeyBorderPay.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
Reference in New Issue
Block a user