开发者

onKeyUp Delphi skipping ever other occurrence

Am u开发者_Go百科sing TJvUltimGrid, when pressing either the up or down arrow, to move from one record to the next, the event fires every other press. Does anyone have any ideas why it does not fire on every press and what I can do to fix it?

The dataset is a TADODataSet. The onKeyDown fires on every press.

REF: Delphi 2010 with Jedi JVCL Version 3.39, Windows XP


As Smasher said, the OnKeyPress event only is only fired for keys with a ASCII char. To respond to the arrow keys you need to use OnKeyDown or OnKeyUp .

Here is a quote from the online help.

The Key parameter in the OnKeyPress event handler is of type Char; therefore, the OnKeyPress event registers the ASCII character of the key pressed. Keys that don't correspond to an ASCII Char value (Shift or F1, for example) don't generate an OnKeyPress event.

Reference: OnKeyPress

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜