CharacterCasing 列挙型

定義

TextBox コントロール内に手動で入力した文字を、大文字と小文字のどちらで表示するかを指定します。

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

フィールド

Lower 1

TextBox に入力した文字は、小文字に変換されます。

Normal 0

TextBox に入力した文字は、変換されません。

Upper 2

TextBox に入力した文字は、大文字に変換されます。

次の例では、このプロパティを CharacterCasing 使用して、手動で入力されたすべての文字を大文字に変換する方法を TextBox示します。

<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

注釈

この列挙体の値は、プログラムによって追加される文字には TextBox 影響しません。

適用対象