Hi everybody,
My manager noticed, that if the textbox uses InputMask and R format (like SSN, for example), the cursor doesn't go to the beginning of the field if clicked in the middle of the textbox like it does for the textboxes without R format. So I am trying to implement this behavior myself.
I put the following code in the Click event of the textbox:
LOCAL lcOldInputMask
WITH THIS
lcOldInputMask = .InputMask
IF EMPTY(.VALUE)
.InputMask = CHRTRAN(.InputMask,"-","")
TEXTBOX::CLICK()
.SELSTART = 0
.SELLENGTH = 999
NODEFAULT
.InputMask = m.lcOldInputMask
ENDIF
ENDWITH
(Similar code in the GotFocus event). I noticed, that this code doesn't work every time. It works like 3,4 times and then it selects some part of the textbox. Do you see the problem or can replicate it?
Thanks in advance.
If it's not broken, fix it until it is.
My Blog