关于cxgrid的问题

https://www.bbsmax.com/A/obzbgPEMJE/


通过Tab跳转cxgrid网格(左右) ,配置如下

cxGrid1DBTableView.OptionsBehavior.FocusCellOnTab:=True;

tab在delphi中用keydown pressdown都捕获不到 

用以下的方法,我单独开的程序可以捕获到tab 但是不知道为什么用在我的程序中就无法相应。

private

YouWantToInterceptTab: Boolean;

// YouWantToInterceptTab为true,就会屏蔽掉tab键,就不会切换控件

{ Private declarations }

procedure CMDialogKey(var AMessage: TCMDialogKey); message CM_DIALOGKEY;

procedure TForm3.CMDialogKey(var AMessage: TCMDialogKey);

begin

if AMessage.CharCode = VK_TAB then

begin

ShowMessage('TAB key has been pressed in ' + ActiveControl.Name);

if YouWantToInterceptTab then

begin

ShowMessage('TAB key will be eaten');

AMessage.Result := 1;

end

else inherited;

end else inherited;

end;

所以还是 cxGrid1DBTableView.OptionsBehavior.FocusCellOnTab:=True;这个方法方便快捷

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • unit Unit1; interface uses Windows, Messages, SysUtils, ...
    netppp阅读 1,508评论 0 0
  • exception 异常处理 end exception 异常处理 end; 第一类 :PL/SQ...
    西南蔡徐坤阅读 3,523评论 0 0
  • https://www.cnblogs.com/chaosc/p/5819178.html -----------...
    netppp阅读 1,454评论 0 0
  • MYSQL 基础知识 1 MySQL数据库概要 2 简单MySQL环境 3 数据的存储和获取 4 MySQL基本操...
    Kingtester阅读 12,399评论 5 116
  • --$理论知识$-- --$$、三大范式 第一范式(1NF):字段是原子性的,不可分; 第二范式(2NF):有主键...
    scottyang95阅读 4,075评论 0 4

友情链接更多精彩内容