'宣言 Public Class UltraProgressBar Inherits Infragistics.Win.UltraControlBase Implements Infragistics.Win.AppStyling.ISupportAppStyling, Infragistics.Win.IProvidesEmbeddableEditor, Infragistics.Win.IUltraControl, Infragistics.Win.IUltraControlElement, Infragistics.Win.Touch.ISupportTouchMetrics, Infragistics.Win.UIAutomation.IProvideUIAutomation, IProgressBarInfo, IProgressBarInfoEx
public class UltraProgressBar : Infragistics.Win.UltraControlBase, Infragistics.Win.AppStyling.ISupportAppStyling, Infragistics.Win.IProvidesEmbeddableEditor, Infragistics.Win.IUltraControl, Infragistics.Win.IUltraControlElement, Infragistics.Win.Touch.ISupportTouchMetrics, Infragistics.Win.UIAutomation.IProvideUIAutomation, IProgressBarInfo, IProgressBarInfoEx
UltraProgressBar を使用してプロセスが完了したパーセントを表示したり、プロセスが処理される長いプロセス中の表示を提供できます。
描画される塗りつぶしのタイプは、Style プロパティから決定できます。塗りつぶされた領域を描画する場合、FillAppearance が使用されてプログレス バーの塗りつぶされた領域の外観を解決します。塗りつぶしは、べた一色、グラデーション、またはパーセントが増す時にカバーされていない背景画像の場合であっても、Style に基づいてべた一色またはセグメントされた領域になります。
UltraProgressBar は、コントロール内にラベル(Text)も表示できます。Text は、ダイナミック ラベルを提供するためにコントロールからの値で置き換えられる特別なエスケープ タグを含むことができます。
Imports Infragistics.Win Imports Infragistics.Win.UltraWinProgressBar Private Sub InitializeProgessBar() With Me.ultraProgressBar1 ' Note: Under Windows XP if the 'SupportThemes' property ' is left set to True (its default setting) then some of ' the explicit appearance and border style property ' settings are ignored. .SupportThemes = False ' Set the appearance of the status bar control ' to use a gradient. .Appearance.BackColor = Color.Gray .Appearance.BackColor2 = Color.White .Appearance.BackGradientStyle = GradientStyle.HorizontalBump .Appearance.ForeColor = Color.Red ' Set the appearance for the 'fill' area of the ' status bar control to use a different gradient. .FillAppearance.BackColor = Color.Blue .FillAppearance.BackColor2 = Color.White .FillAppearance.BackGradientStyle = GradientStyle.HorizontalBump .FillAppearance.ForeColor = Color.Red ' Set the border style for the control .BorderStyle = UIElementBorderStyle.Etched ' Set the minimum, maximum, and value properties. ' For the case below where the minimum value is 45, ' the maximum is 85 and the value is 55, the status ' bar would display 25%. This is because the entire ' range is 40 (85 - 45) and the relative value is 10 ' (55 - 45). .Minimum = 45 .Maximum = 85 .Value = 55 ' Set the amount to increment the value when ' the 'PerformStep' method is called. .Step = 5 ' Set the orientation of the control. .Orientation = Orientation.Vertical ' Set a percent format. The default format is ' "P0" which shows only the percent integer ' value. The "P1" setting below will format ' the percentage with place after the decimal ' point (e.g.. "34.5%"). .PercentFormat = "P1" ' Set the 'text' property to a string that ' contains some substitution strings. The ' code below will cause the progress bar's ' to display its value like the following: ' "Done: 34.4, remaining" Dim sb As New System.Text.StringBuilder() ' Note: There are 10 different substitution string ' constants defined on UltraProgressBar. They are ' prefixed with 'LABEL_'. ' ' The LABEL_FORMATTED substitution string ' will cause the formatted percent completed ' value to be substitued here. sb.Append("Done: ") sb.Append(UltraProgressBar.LABEL_FORMATTED) ' The LABEL_FORMATTED_REMAINING substitution ' string will cause the formatted percent ' remaining value to be substitued here. sb.Append(", remaining: ") sb.Append(UltraProgressBar.LABEL_FORMATTED_REMAINING) ' Set the 'Text' property of the control. ' Note: this corresponds to the 'Label' property ' on the IProgressBarInfo interface. .Text = sb.ToString() ' Set the style of the progress bar to show a ' segmented fill. .Style = ProgressBarStyle.SegmentedPartial ' Set the width of each segement. If the default ' value of -1 is kept the control will calculate ' a reasonable default segment width based on ' the progress bar control's width and height. .SegmentWidth = 6 ' Set the TextVisible property. The default ' value is true so the line below isn't ' required. ' Note: this corresponds to the 'ShowLabel' ' property on the IProgressBarInfo interface. .TextVisible = True End With End Sub
using Infragistics.Win; using Infragistics.Win.UltraWinProgressBar; private void InitializeProgressBar() { UltraProgressBar pbar = this.ultraProgressBar1; // Note: Under Windows XP if the 'SupportThemes' property // is left set to True (its default setting) then some of // the explicit appearance and border style property // settings are ignored. pbar.SupportThemes = false; // Set the appearance of the status bar control // to use a gradient. pbar.Appearance.BackColor = Color.Gray; pbar.Appearance.BackColor2 = Color.White; pbar.Appearance.BackGradientStyle = GradientStyle.HorizontalBump; pbar.Appearance.ForeColor = Color.Red; // Set the appearance for the 'fill' area of the // status bar control to use a different gradient. pbar.FillAppearance.BackColor = Color.Blue; pbar.FillAppearance.BackColor2 = Color.White; pbar.FillAppearance.BackGradientStyle = GradientStyle.HorizontalBump; pbar.FillAppearance.ForeColor = Color.Red; // Set the border style for the control pbar.BorderStyle = UIElementBorderStyle.Etched; // Set the minimum, maximum, and value properties. // For the case below where the minimum value is 45, // the maximum is 85 and the value is 55, the status // bar would display 25%. This is because the entire // range is 40 (85 - 45) and the relative value is 10 // (55 - 45). pbar.Minimum = 45; pbar.Maximum = 85; pbar.Value = 55; // Set the amount to increment the value when // the 'PerformStep' method is called. pbar.Step = 5; // Set the orientation of the control. pbar.Orientation = Orientation.Vertical; // Set a percent format. The default format is // "P0" which shows only the percent integer // value. The "P1" setting below will format // the percentage with place after the decimal // point (e.g.. "34.5%"). pbar.PercentFormat = "P1"; // Set the 'text' property to a string that // contains some substitution strings. The // code below will cause the progress bar's // to display its value like the following: // "Done: 34.4, remaining" System.Text.StringBuilder sb = new System.Text.StringBuilder(); // Note: There are 10 different substitution string // constants defined on UltraProgressBar. They are // prefixed with 'LABEL_'. // // The LABEL_FORMATTED substitution string // will cause the formatted percent completed // value to be substitued here. sb.Append( "Done: "); sb.Append( UltraProgressBar.LABEL_FORMATTED ); // The LABEL_FORMATTED_REMAINING substitution // string will cause the formatted percent // remaining value to be substitued here. sb.Append( ", remaining: "); sb.Append( UltraProgressBar.LABEL_FORMATTED_REMAINING ); // Set the 'Text' property of the control. // Note: this corresponds to the 'Label' property // on the IProgressBarInfo interface. pbar.Text = sb.ToString(); // Set the style of the progress bar to show a // segmented fill. pbar.Style = ProgressBarStyle.SegmentedPartial; // Set the width of each segement. If the default // value of -1 is kept the control will calculate // a reasonable default segment width based on // the progress bar control's width and height. pbar.SegmentWidth = 6; // Set the TextVisible property. The default // value is true so the line below isn't // required. // Note: this corresponds to the 'ShowLabel' // property on the IProgressBarInfo interface. pbar.TextVisible = true; }