Hi Tore,
You are correct re reassigning nKeyCode. It did not work with my subclassed editbox, but it works with the standard editbox.
My mistake.
Gregory
_
>Hi Gregory
>
>Yes, you can re-assign nKeyCode just like you can change any parameter.
>
>I am busy programming just now, and a hour ago I needed to convert all ',' (comma) with '.' (point), and I use the following code which works without any problem:
>
>..
>CASE CHR(nKeyCode)=','
> NODEFAULT
> nKeyCode=ASC('.')
> DODEFAULT()
>..
>
>BTW, I realize that you must add some more code to check for illegal values for nKeyCode, I just try to avoid the Keyboard command, I have learnt not to trust it always.
>
>
>
>>Hi Tore,
>>
>>Have you tested this ?
>>- I have doubts re reassigning nKeyCode
>>- I have doubts re directly applying chr(nkeycode). ie what if nkeycode < 0
>>
>>
>>
>>>Hi
>>>
>>>A better solution for the keypress:
>>>
>>>do case
>>> case chr(nkeycode) <> upper(chr(nkeycode))
>>> NODEFAULT
>>> nKeyCode=asc(upper(chr(nkeycode)))
>>> DODEFAULT()
>>>endcase
>>>
>>>
>>>
>>>
>>>>>Hi everybody.
>>>>>1. How can I make the text in the edit box ‘Justify’ (like MS Word)?
>>>>>2. How can force the input in the edit box as upper case (like format ‘!’ for the text box)?
>>>>>
>>>>>Thanks and Regards,
>>>>>Yashodhan.
>>>>
>>>>
>>>>Yashodhan,
>>>>
>>>>(1) don;t think that is possible
>>>>
>>>>(2) since the ! format does not work, you could trap the char in the keypress event of the edit box. Code below seems to work
>>>>
>>>>** EditBox.KeyPress
>>>>LPARAMETERS nkeycode,nshiftaltctrl
>>>>
>>>>do case
>>>>case between(nkeycode, 0, 255) and inlist(nShiftAltCtrl, 0, 1)
>>>> do case
>>>> case chr(nkeycode) <> upper(chr(nkeycode))
>>>> NODEFAULT
>>>> keyboard upper(chr(nkeycode)) PLAIN
>>>> endcase
>>>>endcase
>>>>
Gregory