* UIProcessBar: 修改不显示百分比时,显示数值
This commit is contained in:
parent
a427a71f1e
commit
4414b86b93
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1
SunnyUI.Demo/Controls/FProcess.designer.cs
generated
1
SunnyUI.Demo/Controls/FProcess.designer.cs
generated
@ -319,7 +319,6 @@ namespace Sunny.UI.Demo
|
||||
this.uiProcessBar3.MinimumSize = new System.Drawing.Size(70, 1);
|
||||
this.uiProcessBar3.Name = "uiProcessBar3";
|
||||
this.uiProcessBar3.Size = new System.Drawing.Size(203, 169);
|
||||
this.uiProcessBar3.Style = Sunny.UI.UIStyle.Custom;
|
||||
this.uiProcessBar3.TabIndex = 103;
|
||||
this.uiProcessBar3.Value = 50;
|
||||
//
|
||||
|
@ -124,7 +124,7 @@ namespace Sunny.UI
|
||||
base.OnPaint(e);
|
||||
|
||||
float processSize;
|
||||
string processText = "0.0%";
|
||||
string processText;
|
||||
|
||||
if (Direction == UILine.LineDirection.Horizontal)
|
||||
processSize = posValue * Width * 1.0f / Maximum;
|
||||
@ -134,7 +134,7 @@ namespace Sunny.UI
|
||||
if (ShowPercent)
|
||||
processText = (posValue * 100.0 / maximum).ToString("F" + DecimalCount) + "%";
|
||||
else
|
||||
processText = (posValue * 1.0 / maximum).ToString("F" + DecimalCount);
|
||||
processText = posValue.ToString();
|
||||
|
||||
SizeF sf = e.Graphics.MeasureString(processText, Font);
|
||||
bool canShow = Height > sf.Height + 4;
|
||||
|
Loading…
x
Reference in New Issue
Block a user