如何实现应用程序中的”回车”成tab?
也就是说当按enter键的时候,产生的效果是按了tab键.
下面是我经常使用的方法:
在你的数据模块中,添加如下代码:
interface
。。。。。。
type
tmessagehandler = class //使得回车消息转换成tab消息
class procedure appmessage(var msg:tmsg;var handled:boolean);
end;
implementation
class procedure tmessagehandler.appmessage(var msg: tmsg; var handled: boolean);
begin
if msg.message=wm_keydown then
if (msg.wparam=vk_return ) and
(
(screen.activeform.activecontrol is tedit) or
(screen.activeform.activecontrol is tcombobox) or
(screen.activeform.activecontrol is tcheckbox) or
(screen.activeform.activecontrol is tradiobutton)