TextBox.CharacterCasing TextBox.CharacterCasing TextBox.CharacterCasing TextBox.CharacterCasing Property

定義

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

プロパティ値

手動で入力した文字が大文字で入力されるか小文字で入力されるかを指定する CharacterCasing 値のいずれか。One of the CharacterCasing values that specifies how manually entered characters are cased. 既定値は、Normal です。The default is Normal.

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

注釈

このプロパティは、プログラムによって追加される文字には影響しません。This property does not affect characters that are added programmatically.

依存プロパティ情報Dependency Property Information

識別子フィールドIdentifier field CharacterCasingProperty
メタデータプロパティがに設定されるtrueMetadata properties set to true NoneNone

適用対象