Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to modify text property of text box in text changed event.But how to do again text changed event not to raise?
Posted

1 solution

Your text change will always raise a new TextChanged event - the only way to prevent it being actioned is to "unhook" the event handler, change the text and then re-hook the handler - which is a nasty way to do things. Instead, I would set up a class level bool which you test at the top of the event handler: if it is true, ignore the handler and just set it false. If it is false, contiunue with the handler, and set it true just before you change the Text property.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900