如何实现应用程序中的”回车”成TAB?[1]

[入库:2005年8月18日] [更新:2007年3月25日]

本文简介:选择自 wangzn1979 的 blog

 如何实现应用程序中的回车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)

本文关键:回车 Tab
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top