If I have time, I'll look at it and see if it can be done. 'Course, I wrote that code in 1998 so I'm a little rusty with it. :-)
>
>I think after spending some time on the class I was unable to fix it and abandoned the whole class idea.
>
>Thanks again.
>
>>Feel free to post the class with the changes as a new file or however you wish.
>>
>>John
>>
>>>Hi John,
>>>
>>>I've downloaded your time class and quickly tried it. It looks good, but when I highlight the whole entry to delete and re-type, it doesn't work. I think KeyPress method should be adjusted for Del and Backspace codes.
>>>
>>>
>>>*:*
>>>*:* Check the position of the cursor and test versus accepted range. If not, lNoDef is set
>>>*:* and the keypress is ignored via NODEFAULT
>>>*:*
>>>LPARAMETERS nKeyCode, nShiftAltCtrl
>>>LOCAL lNoDef
>>>lNoDef=.F.
>>>DO CASE
>>>CASE THIS.SelStart=0
>>> IF !(CHR(nKeyCode) $ "01")
>>> lNoDef=.T.
>>> ENDIF
>>>CASE THIS.SelStart=1 OR THIS.SelStart=4 OR (THIS.SelStart=7 AND !THIS.ShowSeconds)
>>> IF !(CHR(nKeyCode) $ "0123456789")
>>> lNoDef=.T.
>>> ENDIF
>>>CASE THIS.SelStart=3 OR (THIS.SelStart=6 AND !THIS.ShowSeconds)
>>> IF !(CHR(nKeyCode) $ "012345")
>>> lNoDef=.T.
>>> ENDIF
>>>CASE (THIS.SelStart=6 AND !THIS.ShowSeconds) OR (THIS.SelStart=9 AND THIS.ShowSeconds)
>>> IF !(UPPER(CHR(nKeyCode)) $ "AP")
>>> lNoDef=.T.
>>> ENDIF
>>>ENDCASE
>>>IF lNoDef
>>> NODEFAULT
>>>ENDIF
>>>
>>>Do you or anyone already made the adjustments, so I don't have to re-invent the wheel?
>>>
>>>Thanks in advance.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05