Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)?

like image 503
Agnel Kurian Avatar asked Mar 15 '09 15:03

Agnel Kurian


1 Answers

You can use TextBox also.

Write a function GetMyPosition() and put in the events

  • TextChanged()
  • MouseClick()
  • KeyUp() (In KeyDown() the position isn't changed)

When you want to notify the highlighting of a text, you also have to use

  • MouseHover()
like image 153
marsh-wiggle Avatar answered Sep 21 '22 14:09

marsh-wiggle