TextBoxBase.SelectionChanged 事件

定义

在文本选择改变时发生。Occurs when the text selection has changed.

public:
 event System::Windows::RoutedEventHandler ^ SelectionChanged;
public event System.Windows.RoutedEventHandler SelectionChanged;
member this.SelectionChanged : System.Windows.RoutedEventHandler 
Public Custom Event SelectionChanged As RoutedEventHandler 

示例

下面的示例演示如何使用代码处理SelectionChanged事件。The following example demonstrates how to handle the SelectionChanged event by using code.

private void selectChanged(object sender, RoutedEventArgs e)
{
    myTextBox.AppendText("Selection Changed event in myTextBox2 has just occurred.");
}
Private Sub selectChanged(ByVal sender As Object, ByVal e As RoutedEventArgs)
    myTextBox.AppendText("Selection Changed event in myTextBox2 has just occurred.")
End Sub

注解

路由事件信息Routed Event Information

标识符字段Identifier field SelectionChangedEvent
路由策略Routing strategy 冒泡Bubbling
委托Delegate RoutedEventHandler

适用于