Commit 68edc8b1 HZH

添加引用区块

1 个父辈 9c28398e
// ***********************************************************************
// Assembly : HZH_Controls
// Created : 2019-10-15
//
// ***********************************************************************
// <copyright file="UCPanelQuote.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.Linq;
using System.Text;
using System.Windows.Forms;
namespace HZH_Controls.Controls
{
/// <summary>
/// Class UCPanelQuote.
/// Implements the <see cref="System.Windows.Forms.Panel" />
/// </summary>
/// <seealso cref="System.Windows.Forms.Panel" />
public class UCPanelQuote : Panel
{
/// <summary>
/// The border color
/// </summary>
private Color borderColor = LineColors.Light;
/// <summary>
/// Gets or sets the color of the border.
/// </summary>
/// <value>The color of the border.</value>
[Description("边框颜色"), Category("自定义")]
public Color BorderColor
{
get { return borderColor; }
set
{
borderColor = value;
this.Invalidate();
}
}
/// <summary>
/// The left color
/// </summary>
private Color leftColor = StatusColors.Danger;
/// <summary>
/// Gets or sets the color of the left.
/// </summary>
/// <value>The color of the left.</value>
[Description("左侧颜色"), Category("自定义")]
public Color LeftColor
{
get { return leftColor; }
set
{
leftColor = value;
this.Invalidate();
}
}
/// <summary>
/// Initializes a new instance of the <see cref="UCPanelQuote"/> class.
/// </summary>
public UCPanelQuote()
: base()
{
Padding = new Padding(5, 1, 1, 1);
}
/// <summary>
/// 引发 <see cref="E:System.Windows.Forms.Control.Paint" /> 事件。
/// </summary>
/// <param name="e">包含事件数据的 <see cref="T:System.Windows.Forms.PaintEventArgs" />。</param>
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
e.Graphics.SetGDIHigh();
e.Graphics.DrawLines(new Pen(borderColor), new Point[]
{
new Point(e.ClipRectangle.Left,e.ClipRectangle.Top),
new Point(e.ClipRectangle.Right-1,e.ClipRectangle.Top),
new Point(e.ClipRectangle.Right-1,e.ClipRectangle.Bottom-1),
new Point(e.ClipRectangle.Left,e.ClipRectangle.Bottom-1),
new Point(e.ClipRectangle.Left,e.ClipRectangle.Top)
});
e.Graphics.FillRectangle(new SolidBrush(leftColor), new Rectangle(0, 0, 5, this.Height));
}
}
}
...@@ -105,6 +105,9 @@ ...@@ -105,6 +105,9 @@
</Compile> </Compile>
<Compile Include="Controls\Navigation\CrumbNavigationClickEventArgs.cs" /> <Compile Include="Controls\Navigation\CrumbNavigationClickEventArgs.cs" />
<Compile Include="Controls\Navigation\CrumbNavigationItem.cs" /> <Compile Include="Controls\Navigation\CrumbNavigationItem.cs" />
<Compile Include="Controls\Panel\UCPanelQuote.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\Sampling\UCSampling.cs"> <Compile Include="Controls\Sampling\UCSampling.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
......
...@@ -70,6 +70,7 @@ namespace Test ...@@ -70,6 +70,7 @@ namespace Test
tnControl.Nodes.Add("分割线标签"); tnControl.Nodes.Add("分割线标签");
tnControl.Nodes.Add("时间轴"); tnControl.Nodes.Add("时间轴");
tnControl.Nodes.Add("穿梭框"); tnControl.Nodes.Add("穿梭框");
tnControl.Nodes.Add("引用区块");
this.tvMenu.Nodes.Add(tnControl); this.tvMenu.Nodes.Add(tnControl);
TreeNode tnCharts = new TreeNode(" 图表"); TreeNode tnCharts = new TreeNode(" 图表");
...@@ -287,6 +288,9 @@ namespace Test ...@@ -287,6 +288,9 @@ namespace Test
case "穿梭框": case "穿梭框":
AddControl(new UC.UCTestTransfer()); AddControl(new UC.UCTestTransfer());
break; break;
case "引用区块":
AddControl(new UC.UCTestPanelQuote());
break;
#endregion #endregion
#region 图表 English:Chart #region 图表 English:Chart
......
...@@ -242,6 +242,12 @@ ...@@ -242,6 +242,12 @@
<Compile Include="UC\UCTestPage.Designer.cs"> <Compile Include="UC\UCTestPage.Designer.cs">
<DependentUpon>UCTestPage.cs</DependentUpon> <DependentUpon>UCTestPage.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="UC\UCTestPanelQuote.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UC\UCTestPanelQuote.Designer.cs">
<DependentUpon>UCTestPanelQuote.cs</DependentUpon>
</Compile>
<Compile Include="UC\UCTestPanelTitle.cs"> <Compile Include="UC\UCTestPanelTitle.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
...@@ -485,6 +491,9 @@ ...@@ -485,6 +491,9 @@
<EmbeddedResource Include="UC\UCTestPage.resx"> <EmbeddedResource Include="UC\UCTestPage.resx">
<DependentUpon>UCTestPage.cs</DependentUpon> <DependentUpon>UCTestPage.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="UC\UCTestPanelQuote.resx">
<DependentUpon>UCTestPanelQuote.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UC\UCTestPanelTitle.resx"> <EmbeddedResource Include="UC\UCTestPanelTitle.resx">
<DependentUpon>UCTestPanelTitle.cs</DependentUpon> <DependentUpon>UCTestPanelTitle.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
......
namespace Test.UC
{
partial class UCTestPanelQuote
{
/// <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.ucPanelQuote5 = new HZH_Controls.Controls.UCPanelQuote();
this.ucPanelQuote4 = new HZH_Controls.Controls.UCPanelQuote();
this.ucPanelQuote3 = new HZH_Controls.Controls.UCPanelQuote();
this.ucPanelQuote2 = new HZH_Controls.Controls.UCPanelQuote();
this.label2 = new System.Windows.Forms.Label();
this.ucPanelQuote1 = new HZH_Controls.Controls.UCPanelQuote();
this.label1 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.ucPanelQuote5.SuspendLayout();
this.ucPanelQuote4.SuspendLayout();
this.ucPanelQuote3.SuspendLayout();
this.ucPanelQuote2.SuspendLayout();
this.ucPanelQuote1.SuspendLayout();
this.SuspendLayout();
//
// ucPanelQuote5
//
this.ucPanelQuote5.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(144)))), ((int)(((byte)(147)))), ((int)(((byte)(153)))));
this.ucPanelQuote5.Controls.Add(this.label5);
this.ucPanelQuote5.LeftColor = System.Drawing.Color.FromArgb(((int)(((byte)(144)))), ((int)(((byte)(147)))), ((int)(((byte)(153)))));
this.ucPanelQuote5.Location = new System.Drawing.Point(14, 389);
this.ucPanelQuote5.Name = "ucPanelQuote5";
this.ucPanelQuote5.Padding = new System.Windows.Forms.Padding(5, 1, 1, 1);
this.ucPanelQuote5.Size = new System.Drawing.Size(336, 71);
this.ucPanelQuote5.TabIndex = 0;
//
// ucPanelQuote4
//
this.ucPanelQuote4.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(238)))), ((int)(((byte)(245)))));
this.ucPanelQuote4.Controls.Add(this.label4);
this.ucPanelQuote4.LeftColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(162)))), ((int)(((byte)(60)))));
this.ucPanelQuote4.Location = new System.Drawing.Point(14, 295);
this.ucPanelQuote4.Name = "ucPanelQuote4";
this.ucPanelQuote4.Padding = new System.Windows.Forms.Padding(5, 1, 1, 1);
this.ucPanelQuote4.Size = new System.Drawing.Size(336, 71);
this.ucPanelQuote4.TabIndex = 0;
//
// ucPanelQuote3
//
this.ucPanelQuote3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
this.ucPanelQuote3.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(103)))), ((int)(((byte)(194)))), ((int)(((byte)(58)))));
this.ucPanelQuote3.Controls.Add(this.label3);
this.ucPanelQuote3.LeftColor = System.Drawing.Color.FromArgb(((int)(((byte)(103)))), ((int)(((byte)(194)))), ((int)(((byte)(58)))));
this.ucPanelQuote3.Location = new System.Drawing.Point(14, 196);
this.ucPanelQuote3.Name = "ucPanelQuote3";
this.ucPanelQuote3.Padding = new System.Windows.Forms.Padding(5, 1, 1, 1);
this.ucPanelQuote3.Size = new System.Drawing.Size(336, 71);
this.ucPanelQuote3.TabIndex = 0;
//
// ucPanelQuote2
//
this.ucPanelQuote2.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(158)))), ((int)(((byte)(255)))));
this.ucPanelQuote2.Controls.Add(this.label2);
this.ucPanelQuote2.LeftColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(158)))), ((int)(((byte)(255)))));
this.ucPanelQuote2.Location = new System.Drawing.Point(14, 103);
this.ucPanelQuote2.Name = "ucPanelQuote2";
this.ucPanelQuote2.Padding = new System.Windows.Forms.Padding(5, 1, 1, 1);
this.ucPanelQuote2.Size = new System.Drawing.Size(336, 71);
this.ucPanelQuote2.TabIndex = 0;
//
// label2
//
this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
this.label2.Location = new System.Drawing.Point(5, 1);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(330, 69);
this.label2.TabIndex = 1;
this.label2.Text = "这是一个自定义样式的区块";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// ucPanelQuote1
//
this.ucPanelQuote1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(238)))), ((int)(((byte)(245)))));
this.ucPanelQuote1.Controls.Add(this.label1);
this.ucPanelQuote1.LeftColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(108)))), ((int)(((byte)(108)))));
this.ucPanelQuote1.Location = new System.Drawing.Point(14, 14);
this.ucPanelQuote1.Name = "ucPanelQuote1";
this.ucPanelQuote1.Padding = new System.Windows.Forms.Padding(5, 1, 1, 1);
this.ucPanelQuote1.Size = new System.Drawing.Size(336, 71);
this.ucPanelQuote1.TabIndex = 0;
//
// label1
//
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.Location = new System.Drawing.Point(5, 1);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(330, 69);
this.label1.TabIndex = 0;
this.label1.Text = "这是一个默认样式的区块";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label3
//
this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
this.label3.Location = new System.Drawing.Point(5, 1);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(330, 69);
this.label3.TabIndex = 2;
this.label3.Text = "这是一个自定义样式的区块";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label4
//
this.label4.Dock = System.Windows.Forms.DockStyle.Fill;
this.label4.Location = new System.Drawing.Point(5, 1);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(330, 69);
this.label4.TabIndex = 2;
this.label4.Text = "这是一个自定义样式的区块";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label5
//
this.label5.Dock = System.Windows.Forms.DockStyle.Fill;
this.label5.Location = new System.Drawing.Point(5, 1);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(330, 69);
this.label5.TabIndex = 2;
this.label5.Text = "这是一个自定义样式的区块";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// UCTestPanelQuote
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.White;
this.Controls.Add(this.ucPanelQuote5);
this.Controls.Add(this.ucPanelQuote4);
this.Controls.Add(this.ucPanelQuote3);
this.Controls.Add(this.ucPanelQuote2);
this.Controls.Add(this.ucPanelQuote1);
this.Name = "UCTestPanelQuote";
this.Size = new System.Drawing.Size(902, 514);
this.ucPanelQuote5.ResumeLayout(false);
this.ucPanelQuote4.ResumeLayout(false);
this.ucPanelQuote3.ResumeLayout(false);
this.ucPanelQuote2.ResumeLayout(false);
this.ucPanelQuote1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private HZH_Controls.Controls.UCPanelQuote ucPanelQuote1;
private System.Windows.Forms.Label label1;
private HZH_Controls.Controls.UCPanelQuote ucPanelQuote2;
private System.Windows.Forms.Label label2;
private HZH_Controls.Controls.UCPanelQuote ucPanelQuote3;
private HZH_Controls.Controls.UCPanelQuote ucPanelQuote4;
private HZH_Controls.Controls.UCPanelQuote ucPanelQuote5;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
}
}
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 Test.UC
{
public partial class UCTestPanelQuote : UserControl
{
public UCTestPanelQuote()
{
InitializeComponent();
}
}
}
<?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 \ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!