Too weird - all three work fine for me. Works when the control gets focus (tab into it), not on the click event.
Maybe the code needs to be moved to another event? Clicking in the text box will place the cursor, which could be messing the length? All out of suggestions here so far, but I'll keep an eye on the thread.
Good luck!
Before you criticize someone, you should walk a mile in their shoes.
That way, when you criticize them, you're a mile away and you have their shoes.