TextBox: TextChanged event question

  • Thread starter Thread starter Fabio Cannizzo
  • Start date Start date
F

Fabio Cannizzo

Hi.

The content of my textbox is "ABCD".

If I select the letter 'C' and I press 'X', the content obviously changes to
"ABXD".

Thsi however generates two separate "TextChanged" events
1) "ABCD" ==> "ABD"
2) "ABD" ==> "ABXD"

These are 2 sub-operations of one single macro operation from an Undo/Redo
point of view. How can I capture this? The TextChanged event does not convey
any information if an operation is standalone or part of a larger operation.
Is there any property I could look into? Should I look at a different event?

Thanks,
Fabio
 
Fabio Cannizzo said:
Hi.

The content of my textbox is "ABCD".

If I select the letter 'C' and I press 'X', the content obviously changes
to "ABXD".

Thsi however generates two separate "TextChanged" events
1) "ABCD" ==> "ABD"
2) "ABD" ==> "ABXD"

These are 2 sub-operations of one single macro operation from an Undo/Redo
point of view. How can I capture this? The TextChanged event does not
convey any information if an operation is standalone or part of a larger
operation. Is there any property I could look into? Should I look at a
different event?

Thanks,
Fabio
If you are looking to react to the completed change (i.e. when the user is
finished editing the content of the TextBox), you can use the Leave event.
 
Hi. Yes I need to react to the complete "typyng" event, but the focus
may still be on the control, hence I do nto think "leave" would work.

I suppose I can only use a combination of "TextCahnged" and "KeyDown",

Thanks,
Fabio
 

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

Back
Top