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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...