+ UIRoundProcess:圆形滚动条

This commit is contained in:
Sunny 2021-04-08 23:10:53 +08:00
parent 648689588f
commit a58de5e371
9 changed files with 94 additions and 5 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -57,11 +57,13 @@
this.uiLabel3 = new Sunny.UI.UILabel();
this.uiToolTip1 = new Sunny.UI.UIToolTip(this.components);
this.uiProcessBar2 = new Sunny.UI.UIProcessBar();
this.uiRoundProcess1 = new Sunny.UI.UIRoundProcess();
this.PagePanel.SuspendLayout();
this.SuspendLayout();
//
// PagePanel
//
this.PagePanel.Controls.Add(this.uiRoundProcess1);
this.PagePanel.Controls.Add(this.uiProcessBar2);
this.PagePanel.Controls.Add(this.uiLabel3);
this.PagePanel.Controls.Add(this.uiLabel2);
@ -167,7 +169,7 @@
this.uiProgressIndicator1.Location = new System.Drawing.Point(30, 298);
this.uiProgressIndicator1.MinimumSize = new System.Drawing.Size(1, 1);
this.uiProgressIndicator1.Name = "uiProgressIndicator1";
this.uiProgressIndicator1.Size = new System.Drawing.Size(119, 132);
this.uiProgressIndicator1.Size = new System.Drawing.Size(120, 120);
this.uiProgressIndicator1.TabIndex = 26;
this.uiProgressIndicator1.Text = "uiProgressIndicator1";
//
@ -265,7 +267,6 @@
this.uiLedBulb4.BlinkInterval = 500;
this.uiLedBulb4.Location = new System.Drawing.Point(507, 52);
this.uiLedBulb4.Name = "uiLedBulb4";
this.uiLedBulb4.On = false;
this.uiLedBulb4.Size = new System.Drawing.Size(32, 32);
this.uiLedBulb4.TabIndex = 41;
this.uiLedBulb4.Text = "uiLedBulb4";
@ -392,9 +393,24 @@
this.uiProcessBar2.Text = "50.0%";
this.uiProcessBar2.Value = 50;
//
// uiRoundProcess1
//
this.uiRoundProcess1.BackColor = System.Drawing.Color.Transparent;
this.uiRoundProcess1.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiRoundProcess1.Inner = 30;
this.uiRoundProcess1.Location = new System.Drawing.Point(228, 298);
this.uiRoundProcess1.MinimumSize = new System.Drawing.Size(1, 1);
this.uiRoundProcess1.Name = "uiRoundProcess1";
this.uiRoundProcess1.Outer = 50;
this.uiRoundProcess1.ProcessBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(200)))), ((int)(((byte)(255)))));
this.uiRoundProcess1.ProcessColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
this.uiRoundProcess1.Size = new System.Drawing.Size(120, 120);
this.uiRoundProcess1.TabIndex = 57;
this.uiRoundProcess1.Text = "uiRoundProcess1";
this.uiRoundProcess1.Value = 80;
//
// FOther
//
this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(800, 507);
this.Name = "FOther";
@ -435,5 +451,6 @@
private UILabel uiLabel1;
private UIToolTip uiToolTip1;
private UIProcessBar uiProcessBar2;
private UIRoundProcess uiRoundProcess1;
}
}

View File

@ -123,6 +123,9 @@
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="uiToolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>107, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>35</value>
</metadata>

View File

@ -305,8 +305,6 @@ namespace Sunny.UI
/// <param name="e">e</param>
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
if (!Visible || Width <= 0 || Height <= 0) return;
Rectangle rect = new Rectangle(0, 0, Width - 1, Height - 1);
@ -333,6 +331,7 @@ namespace Sunny.UI
path.Dispose();
PaintOther?.Invoke(this, e);
base.OnPaint(e);
}
public event PaintEventHandler PaintOther;

View File

@ -0,0 +1,70 @@
/******************************************************************************
* SunnyUI
* CopyRight (C) 2012-2021 ShenYongHua().
* QQ群56829229 QQ17612584 EMailSunnyUI@QQ.Com
*
* Blog: https://www.cnblogs.com/yhuse
* Gitee: https://gitee.com/yhuse/SunnyUI
* GitHub: https://github.com/yhuse/SunnyUI
*
* SunnyUI.dll can be used for free under the GPL-3.0 license.
* If you use this code, please keep this note.
* 使
******************************************************************************
* : UIRoundProcess.cs
* :
* : V3.0
* : 2021-04-08
*
* 2021-04-08: V3.0.2
******************************************************************************/
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
namespace Sunny.UI
{
/// <summary>
/// 圆形滚动条
/// </summary>
[ToolboxItem(false)]
public class UIRoundProcess : UIControl
{
public UIRoundProcess()
{
Size = new Size(120, 120);
Inner = 30;
Outer = 50;
ProcessColor = UIColor.Blue;
ProcessBackColor = Color.FromArgb(155, 200, 255);
base.BackColor = Color.Transparent;
ShowText = false;
ShowRect = false;
}
public int Inner { get; set; }
public int Outer { get; set; }
public Color ProcessColor { get; set; }
public Color ProcessBackColor { get; set; }
public int Value { get; set; }
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
}
protected override void OnPaintFill(Graphics g, GraphicsPath path)
{
g.FillFan(ProcessBackColor, ClientRectangle.Center(), Inner, Outer, 0, 360);
g.FillFan(ProcessColor, ClientRectangle.Center(), Inner, Outer, -90, Value / 100.0f * 360);
}
}
}