Sdílet prostřednictvím


GroupBoxRenderer.RenderMatchingApplicationState Vlastnost

Definice

Získá nebo nastaví hodnotu urč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 se stav aplikace používá k určení stylu vykreslování; v opačném případě . false Výchozí hodnota je true.

Příklady

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


// 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 ano true, GroupBoxRenderer použije nastavení z Application.RenderWithVisualStyles k určení stylu vykreslování. Pokud RenderMatchingApplicationState ano false, vykreslovací modul se vždy vykresluje pomocí vizuálních stylů.

Platí pro