TextBox.CharacterCasing Propiedad

Definición

Obtiene o establece si se utilizan minúsculas o mayúsculas cuando se escriben los caracteres manualmente en el cuadro de texto.

public:
 property System::Windows::Controls::CharacterCasing CharacterCasing { System::Windows::Controls::CharacterCasing get(); void set(System::Windows::Controls::CharacterCasing value); };
public System.Windows.Controls.CharacterCasing CharacterCasing { get; set; }
member this.CharacterCasing : System.Windows.Controls.CharacterCasing with get, set
Public Property CharacterCasing As CharacterCasing

Valor de propiedad

CharacterCasing

Uno de los valores de CharacterCasing que especifica si se utilizan minúsculas o mayúsculas para los caracteres escritos manualmente. De manera predeterminada, es Normal.

Ejemplos

En el ejemplo siguiente se muestra cómo usar la CharacterCasing propiedad para convertir todos los caracteres escritos manualmente en mayúsculas en un cuadro de texto.

<Page  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
  <StackPanel>

    <!-- The CharacterCasing property of this TextBox is set to "Upper" which 
         causes all manually typed characters to be converted to uppercase. -->
    <TextBox CharacterCasing="Upper" Width="100" />
  </StackPanel>
</Page>
using System.Windows.Controls;
namespace SDKSample
{
    public partial class CharacterCasingExample : Page
    {
        public CharacterCasingExample()
        {
            StackPanel myStackPanel = new StackPanel();

            // Create TextBox.
            TextBox myTextBox = new TextBox();
            myTextBox.Width = 100;

            // The CharacterCasing property of this TextBox is set to 
            // "Upper" which causes all manually typed characters to 
            // be converted to upper case.
            myTextBox.CharacterCasing = CharacterCasing.Upper;
            myStackPanel.Children.Add(myTextBox);
            this.Content = myStackPanel;
        }
    }
}

Imports System.Windows
Imports System.Windows.Controls

Namespace SDKSample
    Partial Public Class CharacterCasingExample
        Inherits Page
        Public Sub New()
            Dim myStackPanel As New StackPanel()

            'Create TextBox
            Dim myTextBox As New TextBox()
            myTextBox.Width = 100

            ' The CharacterCasing property of this TextBox is set to 
            ' "Upper" which causes all manually typed characters to 
            ' be converted to upper case.
            myTextBox.CharacterCasing = CharacterCasing.Upper
            myStackPanel.Children.Add(myTextBox)
            Me.Content = myStackPanel
        End Sub
    End Class
End Namespace

Comentarios

Esta propiedad no afecta a los caracteres que se agregan mediante programación.

Información sobre propiedades de dependencia

Campo identificador CharacterCasingProperty
Propiedades de metadatos establecidas en true Ninguno

Se aplica a