ラベルには、さまざまな値を挿入するために特殊な文字を含めることができます。
例:
[Percent] | 完了したパーセント、書式設定なし |
[RemainingPercent] | 残りのパーセント、書式設定なし |
[Formatted] | 完了したパーセント、書式設定付き(PercentFormat) |
[RemainingFormatted] | 残りのパーセント、書式設定付き(PercentFormat) |
[Remaining] | 残りの量 (Maximum - Value) |
[Completed] | 完了した量 (Value - Minimum) |
[Minimum] | 最小値(Minimum) |
[Maximum] | 最大値(Maximum) |
[Value] | 現在値 (Value) |
[Range] | 値の範囲 (Maximum - Minimum) |
[Formatted] と [RemainingFormatted] を表示するために使用される書式は、PercentFormat を使用して指定できます。
Imports Infragistics.Win Imports Infragistics.Win.UltraWinProgressBar Imports System.Diagnostics Private Sub ultraProgressBar1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ultraProgressBar1.MouseDown Dim mainElement As UIElement Dim element As UIElement ' Get the control's main element mainElement = Me.ultraProgressBar1.UIElement ' Get the element at that point element = mainElement.ElementFromPoint(New Point(e.X, e.Y)) If element Is Nothing Then Return Debug.WriteLine("Clicked on an " + element.GetType().ToString()) Debug.Indent() ' Walk up the parent element chain and write out a line ' for each parent element. While Not element.Parent Is Nothing element = element.Parent Debug.WriteLine("is a child of an " + element.GetType().ToString()) Debug.Indent() End While ' reset the indent level Debug.IndentLevel = 0 End Sub
using System.Diagnostics; using Infragistics.Win; using Infragistics.Win.UltraWinProgressBar; private void ultraProgressBar1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { UIElement mainElement; UIElement element; // Get the control's main element mainElement = this.ultraProgressBar1.UIElement; // Get the element at that point element = mainElement.ElementFromPoint( new Point( e.X, e.Y ) ); if ( element == null ) return; Debug.WriteLine( "Clicked on an " + element.GetType().ToString() ); Debug.Indent(); // Walk up the parent element chain and write out a line // for each parent element. while (element.Parent != null ) { element = element.Parent; Debug.WriteLine("is a child of an " + element.GetType().ToString()); Debug.Indent(); } // reset the indent level Debug.IndentLevel = 0; }