Condividi tramite


CharacterCasing Enumerazione

Definizione

Specifica le maiuscole e le minuscole dei caratteri digitati manualmente in un controllo TextBox

public enum class CharacterCasing
public enum CharacterCasing
type CharacterCasing = 
Public Enum CharacterCasing
Ereditarietà
CharacterCasing

Campi

Lower 1

I caratteri digitati in TextBox vengono convertiti in minuscolo.

Normal 0

I caratteri digitati in TextBox non vengono convertiti.

Upper 2

I caratteri digitati in TextBox vengono convertiti in maiuscolo.

Esempio

Nell'esempio seguente viene illustrato come usare la CharacterCasing proprietà per convertire tutti i caratteri in lettere maiuscole immesse manualmente in un TextBoxoggetto .

<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

Commenti

Il valore di questa enumerazione non influisce sui caratteri aggiunti a livello TextBox di codice.

Si applica a