ProgressBarRenderer.IsSupported プロパティ

定義

visual スタイルを使用してプログレス バー コントロールを描画するために、ProgressBarRenderer クラスを使用できるかどうかを示す値を取得または設定します。

public:
 static property bool IsSupported { bool get(); };
public static bool IsSupported { get; }
static member IsSupported : bool
Public Shared ReadOnly Property IsSupported As Boolean

プロパティ値

ユーザーがオペレーティング システムで visual スタイルを有効にしていて、アプリケーション ウィンドウのクライアント領域に visual スタイルが適用される場合は true。それ以外の場合は false

次のコード例では、 プロパティを IsSupported 使用して、 メソッドを呼び出 DrawVerticalBar すかどうかを判断します。 このコード例は、ProgressBarRenderer クラスのために提供されている大規模な例の一部です。

    // Draw the progress bar in its normal state.
protected:
    virtual void OnPaint(PaintEventArgs^ e) override
    {
        __super::OnPaint(e);

        if (ProgressBarRenderer::IsSupported)
        {
            ProgressBarRenderer::DrawVerticalBar(e->Graphics, 
                ClientRectangle);
            this->Parent->Text = "VerticalProgressBar Enabled";
        }
        else
        {
            this->Parent->Text = "VerticalProgressBar Disabled";
        }
    }
// Draw the progress bar in its normal state.
protected override void OnPaint(PaintEventArgs e)
{
    base.OnPaint(e);

    if (ProgressBarRenderer.IsSupported)
    {
        ProgressBarRenderer.DrawVerticalBar(e.Graphics,
            ClientRectangle);
        this.Parent.Text = "VerticalProgressBar Enabled";
    }
    else
    {
        this.Parent.Text = "VerticalProgressBar Disabled";
    }
}
' Draw the progress bar in its normal state.
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) 
    MyBase.OnPaint(e)
    
    If ProgressBarRenderer.IsSupported Then
        ProgressBarRenderer.DrawVerticalBar(e.Graphics, ClientRectangle)
        Me.Parent.Text = "VerticalProgressBar Enabled"
    Else
        Me.Parent.Text = "VerticalProgressBar Disabled"
    End If

End Sub

注釈

このプロパティが の場合、 falseこのクラスのメソッドとプロパティは を InvalidOperationExceptionスローします。

適用対象

こちらもご覧ください