Jump to content

OnKeyPress Event


dionel1969

Recommended Posts

How or when is supposed that works OnKeypress Eventin the TUniEdit: before or after the control takes character ? I use certain characters in the input data from a EditBox that are not part of the data, but are modifiers.

 

I have the following code:

 

procedure TMainForm.EditBoxKeyPress(Sender: TObject; var Key: Char);

begin

case Key of

 

'0'..'9',

#8, PlusSign,

MinusSign

: begin

end;

 

Slash : begin

Key := #0;

SelectNexItem;

end;

 

else begin

Key := #0;

Beep;

end;

 

end; // case

end;

 

And when I type "Slash" it appears anyway in the EditBox.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...