'宣言 Public Property SelectAllBehavior As MaskSelectAllBehavior
public MaskSelectAllBehavior SelectAllBehavior {get; set;}
このプロパティが SelectEnteredCharacters に設定されると、select-all-text 操作は、隣接するリテラルを含み、最初に入力した文字から最後に入力した文字までのテキストを選択します。
Private Sub Button1_Click(ByVal sender As Object, ByVal e As RoutedEventArgs) Me.maskedEditor1.Mask = "###-##-####" Me.maskedEditor1.Value = "111-22-" Me.maskedEditor1.ClipMode = MaskMode.IncludeBoth Me.maskedEditor1.StartEditMode() Me.maskedEditor1.SelectAllBehavior = MaskSelectAllBehavior.SelectAllCharacters Me.maskedEditor1.SelectAll() Debug.WriteLine("SelectedText with SelectAllCharacters = '" & Me.maskedEditor1.SelectedText & "'") Me.maskedEditor1.SelectAllBehavior = MaskSelectAllBehavior.SelectEnteredCharacters Me.maskedEditor1.SelectAll() Debug.WriteLine("SelectedText with SelectEnteredCharacters = '" & Me.maskedEditor1.SelectedText & "'") End Sub
public void button1_Click( object sender, RoutedEventArgs e ) { this.maskedEditor1.Mask = "###-##-####"; this.maskedEditor1.Value = "111-22-"; this.maskedEditor1.ClipMode = MaskMode.IncludeBoth; this.maskedEditor1.StartEditMode( ); this.maskedEditor1.SelectAllBehavior = MaskSelectAllBehavior.SelectAllCharacters; this.maskedEditor1.SelectAll( ); Debug.WriteLine( "SelectedText with SelectAllCharacters = '" + this.maskedEditor1.SelectedText + "'" ); this.maskedEditor1.SelectAllBehavior = MaskSelectAllBehavior.SelectEnteredCharacters; this.maskedEditor1.SelectAll( ); Debug.WriteLine( "SelectedText with SelectEnteredCharacters = '" + this.maskedEditor1.SelectedText + "'" ); }