TextBox.SelectionChanged event?

P

Peter Duniho

Okay, someone please tell me what I'm missing here. Lots of controls have
a wide variety of events that occur when properties for the control
change. The TextBox control itself has a wide variety, inherited from
Control and TextBoxBase (including a "TextChanged" event, which I am using
for part of this task). But among all of those events, it doesn't appear
that there is a "SelectionChanged" event that would give me notification
of any time the selection range within the text box changes.

I've given a little thought to trying to catch all of the UI input that
might change the selection (keys, mouse clicks and drag, etc.), monitoring
the selection in those events and essentially handling it that way. But
it seems like a pain in the neck, and I have to admit that my need for the
event is outweighed by my unwillingness to go through all the headaches of
doing that (I would like to provide the user some feedback as to how their
changes to the selection in one textbox affects output elsewhere, in
realtime as they change the selection, but it's not a super-important
feature and I can easily do without, rather than spend a lot of time
cobbling together the equivalent of a "SelectionChanged" event).

Any ideas? I'd love to hear that I've just been careless reading the docs
and that there's something like this after all. :)

Thanks,
Pete
 
E

EA

Peter Duniho said:
Okay, someone please tell me what I'm missing here. Lots of controls have
a wide variety of events that occur when properties for the control
change. The TextBox control itself has a wide variety, inherited from
Control and TextBoxBase (including a "TextChanged" event, which I am using
for part of this task). But among all of those events, it doesn't appear
that there is a "SelectionChanged" event that would give me notification
of any time the selection range within the text box changes.

I've given a little thought to trying to catch all of the UI input that
might change the selection (keys, mouse clicks and drag, etc.), monitoring
the selection in those events and essentially handling it that way. But
it seems like a pain in the neck, and I have to admit that my need for the
event is outweighed by my unwillingness to go through all the headaches of
doing that (I would like to provide the user some feedback as to how their
changes to the selection in one textbox affects output elsewhere, in
realtime as they change the selection, but it's not a super-important
feature and I can easily do without, rather than spend a lot of time
cobbling together the equivalent of a "SelectionChanged" event).

Any ideas? I'd love to hear that I've just been careless reading the docs
and that there's something like this after all. :)

Thanks,
Pete


Hey man how's it goin? LOL

RTFM!!!!! LOL

-Jamal Johnson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top