RadioButtonRenderer.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; }
member this.RenderMatchingApplicationState : bool with get, set
Public Shared Property RenderMatchingApplicationState As Boolean

Hodnota vlastnosti

Boolean

truepokud se stav aplikace 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 k zobrazení stylu vykreslování se mění v závislosti na stavu aplikace. Tento příklad kódu je součástí většího příkladu zadaného RadioButtonRenderer pro třídu.

private void button1_Click(object sender, EventArgs e)
{
    Application.VisualStyleState =
        Application.VisualStyleState ^
        VisualStyleState.ClientAndNonClientAreasEnabled;

    GroupBoxRenderer.RenderMatchingApplicationState = true;
    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

    RadioButtonRenderer.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

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

Platí pro