How do I detect where the cursor is in a text box, do an operation that ill change the contents of the box, then put the cursor back where it was before?