AddHandler for textchanged question

  • Thread starter Thread starter cgchris99
  • Start date Start date
C

cgchris99

Guest
I have added this line of code to a couple of my textbox fields

AddHandler txtHeadHeightMax.TextChanged, AddressOf TextBoxChanged
AddHandler txtHeadHeightMin.TextChanged, AddressOf TextBoxChanged

How can I keep this routine from executing while they are still entering the
data.
This Handler fires for every keypress in the field. In this handler code I
have it refresh the screen based on some automatic calculations.
The problem is during the refresh the entry field looses it's cursor
position.

For example. If I enter .7123 on the keyboard...
What happens is the .7 enters fine and the numbers re-calc and the screen
updates and you see 0.7 in the field
Then they press 1 and you end up with 10.7 Because the 0.7 appears from
the screen update and the cursor ends up to the left of the zero.
Then they press 2 and you get 120.7 instead of what should be 0.712

Any ideas on how to correct this? Maybe I am using the wrong handler?

Thanks for any advice
 
Back
Top