Compartir vía


TextBoxBase.SelectionOpacity Propiedad

Definición

Obtiene o establece la opacidad de .SelectionBrush

public:
 property double SelectionOpacity { double get(); void set(double value); };
public double SelectionOpacity { get; set; }
member this.SelectionOpacity : double with get, set
Public Property SelectionOpacity As Double

Valor de propiedad

Opacidad de .SelectionBrush El valor predeterminado es 0.4.

Ejemplos

En el ejemplo siguiente se crea un TextBox y se agrega el texto " This is some text" (Este es un texto). En el ejemplo se establece la SelectionBrush propiedad en rojo y la SelectionOpacity propiedad en 0,5 para personalizar la apariencia del texto seleccionado.

<TextBox SelectionBrush="Red" SelectionOpacity="0.5"
         Foreground="Blue" CaretBrush="Blue">  
  This is some text.
</TextBox>

En la ilustración siguiente se muestra el TextBox objeto del ejemplo anterior con su texto seleccionado.

TextBox con un TextBox selectionBrush rojo Texto seleccionado en un TextBox con SelectionOpacity establecido en 0.5

Comentarios

Si SelectionOpacity se establece en 0, es SelectionBrush transparente y no está visible. Si SelectionOpacity se establece en 1,0 o superior, es SelectionBrush opaco y el texto seleccionado no está visible.

Se aplica a