Search code examples
.netwinformstextbox

Windows Forms: SelectionChanged event for TextBox class


How do I get notified of a selection change in a text box in .NET 2.0? I was unable to find a SelectionChanged event or an OnSelectionChanged method. What is the best workaround for this (without having to PInvoke, of course)?


Solution

  • You could use a RichTextBox and set Multiline to false. It has a OnSelectionChanged.