CharacterCasing 列挙型

定義

TextBox コントロール内に手動で入力した文字を、大文字と小文字のどちらで表示するかを指定します。Specifies the case of characters typed manually into a TextBox control.

public enum class CharacterCasing
public enum CharacterCasing
type CharacterCasing = 
Public Enum CharacterCasing
継承
CharacterCasing

フィールド

Lower 1

TextBox に入力した文字は、小文字に変換されます。Characters typed into a TextBox are converted to lowercase.

Normal 0

TextBox に入力した文字は、変換されません。Characters typed into a TextBox are not converted.

Upper 2

TextBox に入力した文字は、大文字に変換されます。Characters typed into a TextBox are converted to uppercase.

次の例は、 CharacterCasingプロパティを使用して、 TextBoxに手動で入力されたすべての文字を大文字に変換する方法を示しています。The following example shows how to use the CharacterCasing property to convert all characters to uppercase that are manually entered into a TextBox.

<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

注釈

この列挙体の値は、 TextBoxプログラムによってに追加される文字には影響しません。The value of this enumeration does not affect characters that are added to a TextBox programmatically.

適用対象