CharacterCasing Enum
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Specifies the case of characters typed manually into a TextBox control.
public enum class CharacterCasing
public enum CharacterCasing
type CharacterCasing =
Public Enum CharacterCasing
- Inheritance
Name | Value | Description |
---|---|---|
Normal | 0 | Characters typed into a TextBox are not converted. |
Lower | 1 | Characters typed into a TextBox are converted to lowercase. |
Upper | 2 | Characters typed into a TextBox are converted to uppercase. |
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">
<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
The value of this enumeration does not affect characters that are added to a TextBox programmatically.
Produto | Versões |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
Comentários do .NET
O .NET é um projeto código aberto. Selecione um link para fornecer comentários: