Commit 33a4024f HZH

圆形进度条

1 个父辈 b9e4603b
namespace HZH_Controls.Controls
{
partial class UCProcessEllipse
{
/// <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.Font;
}
#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;
using System.Drawing.Drawing2D;
namespace HZH_Controls.Controls
{
public partial class UCProcessEllipse : UserControl
{
[Description("值改变事件"), Category("自定义")]
public event EventHandler ValueChanged;
private Color m_backEllipseColor = Color.FromArgb(22, 160, 133);
/// <summary>
/// 圆背景色
/// </summary>
[Description("圆背景色"), Category("自定义")]
public Color BackEllipseColor
{
get { return m_backEllipseColor; }
set
{
m_backEllipseColor = value;
Refresh();
}
}
private Color m_coreEllipseColor = Color.FromArgb(180, 180, 180);
/// <summary>
/// 内圆颜色,ShowType=Ring 有效
/// </summary>
[Description("内圆颜色,ShowType=Ring 有效"), Category("自定义")]
public Color CoreEllipseColor
{
get { return m_coreEllipseColor; }
set
{
m_coreEllipseColor = value;
Refresh();
}
}
private Color m_valueColor = Color.FromArgb(255, 77, 59);
[Description("值圆颜色"), Category("自定义")]
public Color ValueColor
{
get { return m_valueColor; }
set
{
m_valueColor = value;
Refresh();
}
}
private bool m_isShowCoreEllipseBorder = true;
/// <summary>
/// 内圆是否显示边框,ShowType=Ring 有效
/// </summary>
[Description("内圆是否显示边框,ShowType=Ring 有效"), Category("自定义")]
public bool IsShowCoreEllipseBorder
{
get { return m_isShowCoreEllipseBorder; }
set
{
m_isShowCoreEllipseBorder = value;
Refresh();
}
}
private ValueType m_valueType = ValueType.Percent;
/// <summary>
/// 值文字类型
/// </summary>
[Description("值文字类型"), Category("自定义")]
public ValueType ValueType
{
get { return m_valueType; }
set
{
m_valueType = value;
Refresh();
}
}
private int m_valueWidth = 30;
/// <summary>
/// 外圆值宽度
/// </summary>
[Description("外圆值宽度,ShowType=Ring 有效"), Category("自定义")]
public int ValueWidth
{
get { return m_valueWidth; }
set
{
if (value <= 0 || value > Math.Min(this.Width, this.Height))
return;
m_valueWidth = value;
Refresh();
}
}
private int m_valueMargin = 5;
/// <summary>
/// 外圆值间距
/// </summary>
[Description("外圆值间距"), Category("自定义")]
public int ValueMargin
{
get { return m_valueMargin; }
set
{
if (value < 0 || m_valueMargin >= m_valueWidth)
return;
m_valueMargin = value;
Refresh();
}
}
private int m_maxValue = 100;
/// <summary>
/// 最大值
/// </summary>
[Description("最大值"), Category("自定义")]
public int MaxValue
{
get { return m_maxValue; }
set
{
if (value > m_value || value <= 0)
return;
m_maxValue = value;
Refresh();
}
}
private int m_value = 0;
/// <summary>
/// 当前值
/// </summary>
[Description("当前值"), Category("自定义")]
public int Value
{
get { return m_value; }
set
{
if (m_maxValue < value || value <= 0)
return;
m_value = value;
if (ValueChanged != null)
{
ValueChanged(this, null);
}
Refresh();
}
}
private Font m_font = new Font("Arial Unicode MS", 20);
[Description("文字字体"), Category("自定义")]
public override Font Font
{
get
{
return m_font;
}
set
{
m_font = value;
Refresh();
}
}
Color m_foreColor = Color.White;
[Description("文字颜色"), Category("自定义")]
public override Color ForeColor
{
get
{
return m_foreColor;
}
set
{
m_foreColor = value;
Refresh();
}
}
private ShowType m_showType = ShowType.Ring;
[Description("显示类型"), Category("自定义")]
public ShowType ShowType
{
get { return m_showType; }
set
{
m_showType = value;
Refresh();
}
}
public UCProcessEllipse()
{
InitializeComponent();
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.ResizeRedraw, true);
this.SetStyle(ControlStyles.Selectable, true);
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
this.SetStyle(ControlStyles.UserPaint, true);
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
var g = e.Graphics;
g.SmoothingMode = SmoothingMode.AntiAlias; //使绘图质量最高,即消除锯齿
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.CompositingQuality = CompositingQuality.HighQuality;
int intWidth = Math.Min(this.Size.Width, this.Size.Height);
//底圆
g.FillEllipse(new SolidBrush(m_backEllipseColor), new Rectangle(new Point(0, 0), new Size(intWidth, intWidth)));
if (m_showType == HZH_Controls.Controls.ShowType.Ring)
{
//中心圆
int intCore = intWidth - m_valueWidth * 2;
g.FillEllipse(new SolidBrush(m_coreEllipseColor), new Rectangle(new Point(m_valueWidth, m_valueWidth), new Size(intCore, intCore)));
//中心圆边框
if (m_isShowCoreEllipseBorder)
{
g.DrawEllipse(new Pen(m_valueColor, 2), new Rectangle(new Point(m_valueWidth + 1, m_valueWidth + 1), new Size(intCore - 1, intCore - 1)));
}
if (m_value > 0 && m_maxValue > 0)
{
float fltPercent = (float)m_value / (float)m_maxValue;
if (fltPercent > 1)
{
fltPercent = 1;
}
g.DrawArc(new Pen(m_valueColor, m_valueWidth - m_valueMargin * 2), new RectangleF(new Point(m_valueWidth / 2 + m_valueMargin / 4, m_valueWidth / 2 + m_valueMargin / 4), new SizeF(intWidth - m_valueWidth - m_valueMargin / 2 + (m_valueMargin == 0 ? 0 : 1), intWidth - m_valueWidth - m_valueMargin / 2 + (m_valueMargin == 0 ? 0 : 1))), -90, fltPercent * 360);
string strValueText = m_valueType == HZH_Controls.Controls.ValueType.Percent ? fltPercent.ToString("0%") : m_value.ToString();
System.Drawing.SizeF _txtSize = g.MeasureString(strValueText, this.Font);
g.DrawString(strValueText, this.Font, new SolidBrush(this.ForeColor), new PointF((intWidth - _txtSize.Width) / 2 + 1, (intWidth - _txtSize.Height) / 2 + 1));
}
}
else
{
if (m_value > 0 && m_maxValue > 0)
{
float fltPercent = (float)m_value / (float)m_maxValue;
if (fltPercent > 1)
{
fltPercent = 1;
}
g.FillPie(new SolidBrush(m_valueColor), new Rectangle(m_valueMargin, m_valueMargin, intWidth - m_valueMargin * 2, intWidth - m_valueMargin * 2), -90, fltPercent * 360);
string strValueText = m_valueType == HZH_Controls.Controls.ValueType.Percent ? fltPercent.ToString("0%") : m_value.ToString();
System.Drawing.SizeF _txtSize = g.MeasureString(strValueText, this.Font);
g.DrawString(strValueText, this.Font, new SolidBrush(this.ForeColor), new PointF((intWidth - _txtSize.Width) / 2 + 1, (intWidth - _txtSize.Height) / 2 + 1));
}
}
}
}
public enum ValueType
{
/// <summary>
/// 百分比
/// </summary>
Percent,
/// <summary>
/// 数值
/// </summary>
Absolute
}
public enum ShowType
{
/// <summary>
/// 圆环
/// </summary>
Ring,
/// <summary>
/// 扇形
/// </summary>
Sector
}
}
namespace HZH_Controls.Controls namespace HZH_Controls.Controls
{ {
partial class ProcessExt partial class UCProcessExt
{ {
/// <summary> /// <summary>
/// 必需的设计器变量。 /// 必需的设计器变量。
/// </summary> /// </summary>
private System.ComponentModel.IContainer components = null; private System.ComponentModel.IContainer components = null;
/// <summary> /// <summary>
/// 清理所有正在使用的资源。 /// 清理所有正在使用的资源。
/// </summary> /// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param> /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing) protected override void Dispose(bool disposing)
{ {
if (disposing && (components != null)) if (disposing && (components != null))
{ {
components.Dispose(); components.Dispose();
} }
base.Dispose(disposing); base.Dispose(disposing);
} }
#region 组件设计器生成的代码 #region 组件设计器生成的代码
/// <summary> /// <summary>
/// 设计器支持所需的方法 - 不要 /// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。 /// 使用代码编辑器修改此方法的内容。
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.SuspendLayout(); this.SuspendLayout();
// //
// panel1 // panel1
// //
this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(23)))), ((int)(((byte)(127)))), ((int)(((byte)(203))))); 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.Dock = System.Windows.Forms.DockStyle.Left;
this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1"; this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(0, 22); this.panel1.Size = new System.Drawing.Size(0, 22);
this.panel1.TabIndex = 0; this.panel1.TabIndex = 0;
// //
// ProcessExt // ProcessExt
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.White; this.BackColor = System.Drawing.Color.White;
this.ConerRadius = 5; this.ConerRadius = 5;
this.Controls.Add(this.panel1); this.Controls.Add(this.panel1);
this.IsRadius = true; this.IsRadius = true;
this.Name = "ProcessExt"; this.Name = "ProcessExt";
this.Size = new System.Drawing.Size(291, 22); this.Size = new System.Drawing.Size(291, 22);
this.SizeChanged += new System.EventHandler(this.ProcessExt_SizeChanged); this.SizeChanged += new System.EventHandler(this.ProcessExt_SizeChanged);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
#endregion #endregion
private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel1;
} }
} }
// 版权所有 黄正辉 交流群:568015492 QQ:623128629 // 版权所有 黄正辉 交流群:568015492 QQ:623128629
// 文件名称:ProcessExt.cs // 文件名称:ProcessExt.cs
// 创建日期:2019-08-15 16:02:44 // 创建日期:2019-08-15 16:02:44
// 功能描述:Process // 功能描述:Process
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control // 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Drawing; using System.Drawing;
using System.Data; using System.Data;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
namespace HZH_Controls.Controls namespace HZH_Controls.Controls
{ {
public partial class ProcessExt : UCControlBase public partial class UCProcessExt : UCControlBase
{ {
private int _value = 0; private int _value = 0;
public int Value public int Value
{ {
get { return this._value; } get { return this._value; }
set set
{ {
if (value < 0) if (value < 0)
return; return;
this._value = value; this._value = value;
SetValue(); SetValue();
} }
} }
private int maxValue = 100; private int maxValue = 100;
public int MaxValue public int MaxValue
{ {
get { return maxValue; } get { return maxValue; }
set set
{ {
if (value <= 0) if (value <= 0)
return; return;
maxValue = value; maxValue = value;
SetValue(); SetValue();
} }
} }
private void SetValue() private void SetValue()
{ {
double dbl = (double)_value / (double)maxValue; double dbl = (double)_value / (double)maxValue;
this.panel1.Width = (int)(this.Width * dbl); this.panel1.Width = (int)(this.Width * dbl);
} }
public ProcessExt() public UCProcessExt()
{ {
InitializeComponent(); InitializeComponent();
} }
private void ProcessExt_SizeChanged(object sender, EventArgs e) private void ProcessExt_SizeChanged(object sender, EventArgs e)
{ {
SetValue(); SetValue();
} }
public void Step() public void Step()
{ {
Value++; Value++;
} }
} }
} }
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<root> <root>
<!-- <!--
Microsoft ResX Schema Microsoft ResX Schema
Version 2.0 Version 2.0
The primary goals of this format is to allow a simple XML format The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes various data types are done through the TypeConverter classes
associated with the data types. associated with the data types.
Example: Example:
... ado.net/XML headers & schema ... ... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader> <resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, 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="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="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value> <value>[base64 mime encoded serialized .NET Framework object]</value>
</data> </data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <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> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment> <comment>This is a comment</comment>
</data> </data>
There are any number of "resheader" rows that contain simple There are any number of "resheader" rows that contain simple
name/value pairs. name/value pairs.
Each data row contains a name, and value. The row also contains a Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture. text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the Classes that don't support this are serialized and stored with the
mimetype set. mimetype set.
The mimetype is used for serialized objects, and tells the The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly: extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below. read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64 mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64 mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64 mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter : using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding. : 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: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:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true"> <xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType> <xsd:complexType>
<xsd:choice maxOccurs="unbounded"> <xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata"> <xsd:element name="metadata">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" /> <xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" /> <xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" /> <xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="assembly"> <xsd:element name="assembly">
<xsd:complexType> <xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" /> <xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" /> <xsd:attribute name="name" type="xsd:string" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="data"> <xsd:element name="data">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <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:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> <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="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" /> <xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="resheader"> <xsd:element name="resheader">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" /> <xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
</xsd:choice> </xsd:choice>
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
</xsd:schema> </xsd:schema>
<resheader name="resmimetype"> <resheader name="resmimetype">
<value>text/microsoft-resx</value> <value>text/microsoft-resx</value>
</resheader> </resheader>
<resheader name="version"> <resheader name="version">
<value>2.0</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
</root> </root>
\ No newline at end of file \ No newline at end of file
...@@ -104,6 +104,12 @@ ...@@ -104,6 +104,12 @@
<Compile Include="Controls\Panel\UCPanelTitle.Designer.cs"> <Compile Include="Controls\Panel\UCPanelTitle.Designer.cs">
<DependentUpon>UCPanelTitle.cs</DependentUpon> <DependentUpon>UCPanelTitle.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Controls\Process\UCProcessEllipse.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\Process\UCProcessEllipse.Designer.cs">
<DependentUpon>UCProcessEllipse.cs</DependentUpon>
</Compile>
<Compile Include="Controls\Step\UCStep.cs"> <Compile Include="Controls\Step\UCStep.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
...@@ -211,11 +217,11 @@ ...@@ -211,11 +217,11 @@
<Compile Include="Controls\List\UCPagerControlBase.cs"> <Compile Include="Controls\List\UCPagerControlBase.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
<Compile Include="Controls\Process\ProcessExt.cs"> <Compile Include="Controls\Process\UCProcessExt.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
<Compile Include="Controls\Process\ProcessExt.Designer.cs"> <Compile Include="Controls\Process\UCProcessExt.Designer.cs">
<DependentUpon>ProcessExt.cs</DependentUpon> <DependentUpon>UCProcessExt.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Controls\RadioButton\UCRadioButton.cs"> <Compile Include="Controls\RadioButton\UCRadioButton.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
...@@ -417,8 +423,8 @@ ...@@ -417,8 +423,8 @@
<EmbeddedResource Include="Controls\Panel\UCPanelTitle.resx"> <EmbeddedResource Include="Controls\Panel\UCPanelTitle.resx">
<DependentUpon>UCPanelTitle.cs</DependentUpon> <DependentUpon>UCPanelTitle.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Controls\Process\ProcessExt.resx"> <EmbeddedResource Include="Controls\Process\UCProcessExt.resx">
<DependentUpon>ProcessExt.cs</DependentUpon> <DependentUpon>UCProcessExt.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Controls\RadioButton\UCRadioButton.resx"> <EmbeddedResource Include="Controls\RadioButton\UCRadioButton.resx">
<DependentUpon>UCRadioButton.cs</DependentUpon> <DependentUpon>UCRadioButton.cs</DependentUpon>
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
this.ucBtnsGroup1 = new HZH_Controls.Controls.UCBtnsGroup(); this.ucBtnsGroup1 = new HZH_Controls.Controls.UCBtnsGroup();
this.groupBox13 = new System.Windows.Forms.GroupBox(); this.groupBox13 = new System.Windows.Forms.GroupBox();
this.ucBtnsGroup2 = new HZH_Controls.Controls.UCBtnsGroup(); this.ucBtnsGroup2 = new HZH_Controls.Controls.UCBtnsGroup();
this.processExt1 = new HZH_Controls.Controls.ProcessExt(); this.processExt1 = new HZH_Controls.Controls.UCProcessExt();
this.ucSplitLine_H1 = new HZH_Controls.Controls.UCSplitLine_H(); this.ucSplitLine_H1 = new HZH_Controls.Controls.UCSplitLine_H();
this.ucSplitLine_V1 = new HZH_Controls.Controls.UCSplitLine_V(); this.ucSplitLine_V1 = new HZH_Controls.Controls.UCSplitLine_V();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
...@@ -1102,7 +1102,7 @@ ...@@ -1102,7 +1102,7 @@
private HZH_Controls.Controls.UCBtnsGroup ucBtnsGroup1; private HZH_Controls.Controls.UCBtnsGroup ucBtnsGroup1;
private System.Windows.Forms.GroupBox groupBox13; private System.Windows.Forms.GroupBox groupBox13;
private HZH_Controls.Controls.UCBtnsGroup ucBtnsGroup2; private HZH_Controls.Controls.UCBtnsGroup ucBtnsGroup2;
private HZH_Controls.Controls.ProcessExt processExt1; private HZH_Controls.Controls.UCProcessExt processExt1;
private HZH_Controls.Controls.UCSplitLine_H ucSplitLine_H1; private HZH_Controls.Controls.UCSplitLine_H ucSplitLine_H1;
private HZH_Controls.Controls.UCSplitLine_V ucSplitLine_V1; private HZH_Controls.Controls.UCSplitLine_V ucSplitLine_V1;
} }
......
...@@ -28,10 +28,35 @@ ...@@ -28,10 +28,35 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.ucProcessEllipse1 = new HZH_Controls.Controls.UCProcessEllipse();
this.ucPanelTitle1 = new HZH_Controls.Controls.UCPanelTitle(); this.ucPanelTitle1 = new HZH_Controls.Controls.UCPanelTitle();
this.ucStep1 = new HZH_Controls.Controls.UCStep(); this.ucStep1 = new HZH_Controls.Controls.UCStep();
this.SuspendLayout(); this.SuspendLayout();
// //
// timer1
//
this.timer1.Enabled = true;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// ucProcessEllipse1
//
this.ucProcessEllipse1.BackEllipseColor = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(160)))), ((int)(((byte)(133)))));
this.ucProcessEllipse1.CoreEllipseColor = System.Drawing.Color.FromArgb(((int)(((byte)(180)))), ((int)(((byte)(180)))), ((int)(((byte)(180)))));
this.ucProcessEllipse1.IsShowCoreEllipseBorder = true;
this.ucProcessEllipse1.Location = new System.Drawing.Point(78, 117);
this.ucProcessEllipse1.MaxValue = 100;
this.ucProcessEllipse1.Name = "ucProcessEllipse1";
this.ucProcessEllipse1.ShowType = HZH_Controls.Controls.ShowType.Sector;
this.ucProcessEllipse1.Size = new System.Drawing.Size(150, 150);
this.ucProcessEllipse1.TabIndex = 2;
this.ucProcessEllipse1.Value = 45;
this.ucProcessEllipse1.ValueColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(59)))));
this.ucProcessEllipse1.ValueMargin = 0;
this.ucProcessEllipse1.ValueType = HZH_Controls.Controls.ValueType.Percent;
this.ucProcessEllipse1.ValueWidth = 30;
//
// ucPanelTitle1 // ucPanelTitle1
// //
this.ucPanelTitle1.BackColor = System.Drawing.Color.Transparent; this.ucPanelTitle1.BackColor = System.Drawing.Color.Transparent;
...@@ -74,6 +99,7 @@ ...@@ -74,6 +99,7 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.White; this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(825, 594); this.ClientSize = new System.Drawing.Size(825, 594);
this.Controls.Add(this.ucProcessEllipse1);
this.Controls.Add(this.ucPanelTitle1); this.Controls.Add(this.ucPanelTitle1);
this.Controls.Add(this.ucStep1); this.Controls.Add(this.ucStep1);
this.Name = "Form2"; this.Name = "Form2";
...@@ -86,5 +112,7 @@ ...@@ -86,5 +112,7 @@
private HZH_Controls.Controls.UCStep ucStep1; private HZH_Controls.Controls.UCStep ucStep1;
private HZH_Controls.Controls.UCPanelTitle ucPanelTitle1; private HZH_Controls.Controls.UCPanelTitle ucPanelTitle1;
private HZH_Controls.Controls.UCProcessEllipse ucProcessEllipse1;
private System.Windows.Forms.Timer timer1;
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -20,5 +20,12 @@ namespace Test ...@@ -20,5 +20,12 @@ namespace Test
{ {
this.ucStep1.StepIndex = 3; this.ucStep1.StepIndex = 3;
} }
private void timer1_Tick(object sender, EventArgs e)
{
this.ucProcessEllipse1.Value++;
if (this.ucProcessEllipse1.Value == 100)
timer1.Enabled = false;
}
} }
} }
...@@ -117,4 +117,7 @@ ...@@ -117,4 +117,7 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root> </root>
\ No newline at end of file \ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!