TextBox.CharacterCasing Propriété

Définition

Obtient ou définit la casse des caractères lorsqu'ils sont entrés manuellement dans la zone de texte.Gets or sets how characters are cased when they are manually entered into the text box.

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

Valeur de propriété

CharacterCasing

L'une des valeurs CharacterCasing qui spécifie la casse des caractères qui sont entrés manuellement.One of the CharacterCasing values that specifies how manually entered characters are cased. La valeur par défaut est Normal.The default is Normal.

Exemples

L’exemple suivant montre comment utiliser la CharacterCasing propriété pour convertir tous les caractères entrés manuellement en majuscules dans une zone de texte.The following example shows how to use the CharacterCasing property to convert all manually entered characters to uppercase in a text box.

<Page  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <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;
using System.Windows;
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

Remarques

Cette propriété n’affecte pas les caractères ajoutés par programmation.This property does not affect characters that are added programmatically.

Informations sur les propriétés de dépendanceDependency Property Information

Champ d’identificateurIdentifier field CharacterCasingProperty
Propriétés de métadonnées définies sur trueMetadata properties set to true AucunNone

S’applique à