'宣言 Public Overloads Overridable Sub ResolveFillAppearance( _ ByRef appearance As AppearanceData, _ ByRef requestedProps As AppearancePropFlags _ )
public virtual void ResolveFillAppearance( ref AppearanceData appearance, ref AppearancePropFlags requestedProps )
塗りつぶされた外観の解決された値のメイン ソースは IProgressBarInfo.FillAppearance です。ただし、塗りつぶされた領域と塗りつぶされていない領域からのテキストをまったく同じサイズと位置に設定する必要があるため、IProgressBarInfo.Appearance の対応する値を使用して、Infragistics.Win.AppearanceBase.FontData、Infragistics.Win.AppearanceBase.TextTrimming、Infragistics.Win.AppearanceBase.TextHAlign、および Infragistics.Win.AppearanceBase.TextVAlign は解決されます。
Imports Infragistics.Win Imports Infragistics.Win.UltraWinProgressBar Imports System.Diagnostics Private Sub button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button2.Click Dim appData As AppearanceData Dim requestedProps As AppearancePropFlags ' ---------------------------------------- ' Resolve the appearance of a progress bar ' ---------------------------------------- ' Initialize the appearance data structure appData = New AppearanceData() ' Specify which appearance properties we want to resolve. ' In this case just the backcolor and forecolor. requestedProps = AppearancePropFlags.BackColor Or AppearancePropFlags.ForeColor ' Call the control's 'ResolveAppearance' method Me.ultraProgressBar1.ResolveAppearance(appData, requestedProps) ' Note: The reason that the 'requestedProps' parameter ' is also passed in by reference is that as each requested ' property is resolved its bit is stripped out of the ' passed in parameter. On return from the call the only ' bits remaining in 'requestedProps' will be those ' properties which were not resolved. Normally, ' 'requestedProps' has no bits set after the call returns. ' Write out the resolved colors Debug.WriteLine("BackColor: " + appData.BackColor.ToString() + ", ForeColor: " + appData.ForeColor.ToString()) ' ---------------------------------------- ' Resolve the appearance for the fill area ' ---------------------------------------- ' Re-initialize the appearance data structure appData = New AppearanceData() ' Specify which appearance properties we want to resolve. ' In this case we want all 'Render' properties. This ' includes every property but the 'Cursor' property. requestedProps = AppearancePropFlags.AllRender ' Call the control's 'ResolveFillAppearance' method ' to resolve the appearance of the fill area of the ' control. Me.ultraProgressBar1.ResolveFillAppearance(appData, requestedProps) ' Write out the resolved gradient related properties. Debug.WriteLine("BackGradientStyle: " + appData.BackGradientStyle.ToString() + ", BackColor: " + appData.BackColor.ToString() + ", BackColor2: " + appData.BackColor2.ToString()) End Sub
using System.Diagnostics; using Infragistics.Win; using Infragistics.Win.UltraWinProgressBar; private void button2_Click(object sender, System.EventArgs e) { AppearanceData appData; AppearancePropFlags requestedProps; // ---------------------------------------- // Resolve the appearance of a progress bar // ---------------------------------------- // Initialize the appearance data structure appData = new AppearanceData(); // Specify which appearance properties we want to resolve. // In this case just the backcolor and forecolor. requestedProps = AppearancePropFlags.BackColor | AppearancePropFlags.ForeColor; // Call the control's 'ResolveAppearance' method this.ultraProgressBar1.ResolveAppearance( ref appData, ref requestedProps ); // Note: The reason that the 'requestedProps' parameter // is also passed in by reference is that as each requested // property is resolved its bit is stripped out of the // passed in parameter. On return from the call the only // bits remaining in 'requestedProps' will be those // properties which were not resolved. Normally, // 'requestedProps' has no bits set after the call returns. // Write out the resolved colors Debug.WriteLine("BackColor: " + appData.BackColor.ToString() + ", ForeColor: " + appData.ForeColor.ToString() ); // ---------------------------------------- // Resolve the appearance for the fill area // ---------------------------------------- // Re-initialize the appearance data structure appData = new AppearanceData(); // Specify which appearance properties we want to resolve. // In this case we want all 'Render' properties. This // includes every property but the 'Cursor' property. requestedProps = AppearancePropFlags.AllRender; // Call the control's 'ResolveFillAppearance' method // to resolve the appearance of the fill area of the // control. this.ultraProgressBar1.ResolveFillAppearance( ref appData, ref requestedProps ); // Write out the resolved gradient related properties. Debug.WriteLine("BackGradientStyle: " + appData.BackGradientStyle.ToString() + ", BackColor: " + appData.BackColor.ToString() + ", BackColor2: " + appData.BackColor2.ToString() ); }