GroupBoxRenderer.RenderMatchingApplicationState Vlastnost

Definice

Získá nebo nastaví hodnotu označující, zda renderer používá stav aplikace k určení stylu vykreslování.

public:
 static property bool RenderMatchingApplicationState { bool get(); void set(bool value); };
public static bool RenderMatchingApplicationState { get; set; }
static member RenderMatchingApplicationState : bool with get, set
Public Shared Property RenderMatchingApplicationState As Boolean

Hodnota vlastnosti

truepokud stav aplikace se používá k určení stylu vykreslování; v opačném případě . false Výchozí formát je true.

Příklady

Následující příklad kódu používá RenderMatchingApplicationState vlastnost ke změně, zda se skupinové pole vykresluje pomocí vizuálních stylů. Tento příklad kódu je součástí většího příkladu GroupBoxRenderer pro třídu .


// Match application style and toggle visual styles off
// and on for the application.
    private void button1_Click(object sender, EventArgs e)
    {
        GroupBoxRenderer.RenderMatchingApplicationState = true;
        Application.VisualStyleState = 
            Application.VisualStyleState ^ 
            VisualStyleState.ClientAndNonClientAreasEnabled;

        if (Application.RenderWithVisualStyles)
            this.Text = "Visual Styles Enabled";
        else
            this.Text = "Visual Styles Disabled";
    }
' Match application style and toggle visual styles off
' and on for the application.
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) _
    Handles button1.Click

    GroupBoxRenderer.RenderMatchingApplicationState = True

    Application.VisualStyleState = _
        Application.VisualStyleState Xor _
        VisualStyleState.ClientAndNonClientAreasEnabled

    If Application.RenderWithVisualStyles Then
        Me.Text = "Visual Styles Enabled"
    Else
        Me.Text = "Visual Styles Disabled"
    End If

End Sub

Poznámky

Pokud RenderMatchingApplicationState je true, GroupBoxRenderer použije k určení stylu vykreslování nastavení z Application.RenderWithVisualStyles . Pokud RenderMatchingApplicationState je false, vykreslovací modul se vždy vykresluje pomocí vizuálních stylů.

Platí pro