GroupBoxRenderer.RenderMatchingApplicationState Egenskap

Definition

Hämtar eller anger ett värde som anger om renderaren använder programtillståndet för att fastställa renderingsformat.

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

Egenskapsvärde

trueom programtillståndet används för att fastställa renderingsformat; annars . false Standardvärdet är true.

Exempel

I följande kodexempel används RenderMatchingApplicationState egenskapen för att ändra om en gruppruta återges med hjälp av visuella format. Det här kodexemplet är en del av ett större exempel för GroupBoxRenderer klassen.


// 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

Kommentarer

Om RenderMatchingApplicationState är trueanvänder GroupBoxRenderer inställningen från Application.RenderWithVisualStyles för att fastställa återgivningsformatet. Om RenderMatchingApplicationState är falserenderar renderaren alltid med hjälp av visuella format.

Gäller för