Compartir vía


GroupBoxRenderer.RenderMatchingApplicationState Propiedad

Definición

Obtiene o establece un valor que indica si el representador utiliza el estado de la aplicación para determinar el estilo de representació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

Valor de propiedad

Boolean

true si el estado de la aplicación se utiliza para determinar el estilo de representación; en caso contrario, es false. De manera predeterminada, es true.

Ejemplos

En el ejemplo de código siguiente se usa la RenderMatchingApplicationState propiedad para cambiar si un cuadro de grupo se representa mediante estilos visuales. Este ejemplo de código es parte de un ejemplo mayor proporcionado para la clase 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

Comentarios

Si RenderMatchingApplicationState es true, usa GroupBoxRenderer el valor de Application.RenderWithVisualStyles para determinar el estilo de representación. Si RenderMatchingApplicationState es false, el representador siempre se representará mediante estilos visuales.

Se aplica a