DECLARE SUB OnKeyPress_edtMyEdit (key AS BYTE)
SUB OnKeyPress_edtMyEdit (key AS BYTE)
DEFSTR sFileAcceptedChar = "abcdefghijklmnopqrstuvwxyz" _
& "ABCDEFGHIJKLMNOPQRSTUVWXYZ" _
& "#!$&().0123456789=@[]_}{~"
IF INSTR (sFileAcceptedChar,CHR$(Key)) THEN
SHOWMESSAGE (CHR$(Key))
ELSE
IF Key = &H0D THEN edtMyEdit.Text = TIME$
END IF
END SUB
CREATE edtMyEdit AS QEDIT
Left = 5
Top = 5
Width = 60
Height = 20
Font.Size = 8
Font.Bold = True
Text = "22523"
OnKeyPress = OnKeyPress_edtMyEdit
END CREATE
|