TextBox.CharacterCasing 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定將字元手動輸入文字方塊時的大小寫。
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 值,這個值指定手動輸入之字元的大小寫。 預設為 Normal。
範例
下列範例示範如何使用 CharacterCasing 屬性,將所有手動輸入的字元轉換成文字方塊中的大寫。
<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
備註
此屬性不會影響以程式設計方式新增的字元。
相依性屬性資訊
識別碼欄位 | CharacterCasingProperty |
中繼資料屬性設定為 true |
無 |