CharacterCasing 枚举
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
指定手动键入到 TextBox 控件中的字符的大小写。
public enum class CharacterCasing
public enum CharacterCasing
type CharacterCasing =
Public Enum 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 字符。