TextBox.CharacterCasing プロパティ

定義

テキスト ボックスに手動で文字を入力した場合に大文字で入力されるか小文字で入力されるかを取得または設定します。

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

プロパティ値

CharacterCasing

手動で入力した文字が大文字で入力されるか小文字で入力されるかを指定する CharacterCasing 値のいずれか。 既定値は、Normal です。

次の例では、このプロパティを使用 CharacterCasing して、手動で入力したすべての文字をテキスト ボックス内の大文字に変換する方法を示します。

<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

注釈

このプロパティは、プログラムによって追加される文字には影響しません。

依存プロパティ情報

識別子フィールド CharacterCasingProperty
メタデータのプロパティが次に設定されている true なし

適用対象