Export (0) Print
Expand All

TextBox.CharacterCasing Property

Gets or sets how characters are cased when they are manually entered into the text box.

Namespace:  System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

public CharacterCasing CharacterCasing { get; set; }
<object CharacterCasing="CharacterCasing" .../>

Property Value

Type: System.Windows.Controls.CharacterCasing
One of the CharacterCasing values that specifies how manually entered characters are cased. The default is CharacterCasing.Normal.

Identifier field

CharacterCasingProperty

Metadata properties set to true

None

This property does not affect characters that are added programmatically.

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;
        }
    }
}

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft