发现,主FORM 定义的快捷键,在二级FORM里也有效。

反过来,就无效。

这样的话,就要考虑 快捷键的冲突问题 了,本来以为不同的FORM 是独立的。

http://codeverge.com/embarcadero.delphi.vcl.using/shortcuts-of-the-main-form-acces/1076501

John Schmidt wrote:

> Hi,
>
> I experience problems when using keys in nonmodal shown SDI forms of
> the application if they are used as shortcuts in the main form. Iif
> the sub-form is shown modal than all works fine. How can I work
> around this 'feature'? - It's URGENT! - Thanks! The behaviour is actually intentional, it is for the support of typical
SDI apps where only the main form has a menu that is "shared" by the
child forms (an app like the IDE itself). Quite a bit of the VCL
behaviour is dictated by the requirements of the IDE... To fix this problem you have to override the main form's IsShortcut
method, like this: public
function IsShortCut(var Message: TWMKey): Boolean; override; function TMainform.IsShortcut( Var Message: TWMKey ): Boolean;
begin
if Screen.Activeform <> self then
Result := false
else
Result := inherited IsShortcut(Message);
end; This way the main form will only process shortcuts when it itself is
the active form. --
Peter Below (TeamB)
Don't be a vampire (http://slash7.com/pages/vampires),
use the newsgroup archives :
http://codenewsfast.com
http://groups.google.com

FormShortCut MainForm 和 二级FORM的更多相关文章

  1. 为WLW开发Latex公式插件

    WLW是写博客的利器,支持离线.格式排版等,而且拥有众多的插件.博客园推荐了代码插入插件,但是没有提供WLW的公式编译插件.目前我的一般做法是:先在Word下使用MathType编辑好公式,然后将公式 ...

  2. Javascript中,document.getElementsByName获取的就一定是数组了么?

    今天在一张JSP网页中,写一个javascript方法,用于全选. 全部被选checkBox位于一个名为mainForm的Form下,name=pushIds.方法如下: function selec ...

  3. 单实例运行tz

    (引用了 Microsoft.VisualBasic.ApplicationServices)SingleInstanceApplicationWrapper.cs    using System.W ...

  4. 单实例 winform zz

    (引用了 Microsoft.VisualBasic.ApplicationServices)SingleInstanceApplicationWrapper.cs using System.Wind ...

  5. Delphi 颜色转换

    http://files.cnblogs.com/xe2011/StringToColor.rar unit Unit1; interface uses Windows, Messages, SysU ...

  6. C# 使用摄像头拍照 支持Win7 64位

    原文:C# 使用摄像头拍照 支持Win7 64位 So, how do we capture an image from a WebCam? Once you download the source ...

  7. Windows Live Writer介绍及相关问题解决

    今天本来想说更新一篇我的文章,更新的过程中添加了很多的内容,里面的图片太多了,导致我浏览器占用的内存不断增大,浏览器变得很卡,最后过了好久我终于更新完文章打算保存的时候居然卡住,然后所有我更新的文字和 ...

  8. c#设计应用程序单实例运行

    利用WindowsFormsApplicationBase的IsSingleInstance来控制应用程序只能单实例运行. [DllImport("user32.dll", Ent ...

  9. sSkinProvider.pas

    unit sSkinProvider;{$I sDefs.inc}{.$DEFINE LOGGED} interface uses Windows, Messages, SysUtils, Class ...

随机推荐

  1. Python3基础 父,子类普通方法重名 子类方法覆盖父类方法

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  2. linux下如何查看当前机器提供了哪些服务

    答:使用netstat工具 在命令行下输入netstat -atun即可列出当前机器提供的服务 netstat各选项解析: -a 列出所有服务 -t 列出tcp相关 -u 列出udp相关 -n 以数字 ...

  3. babun安装,整合到cmder

    babun Babun的特性: 预装了Cygwin以及许多的插件 默认的命令行安装工具,没有管理员权限要求. 预装了 pact工具,一个高级的包管理器,类似 apt-get或yum xTerm-256 ...

  4. 移动距离|2015年蓝桥杯B组题解析第八题-fishers

    移动距离 X星球居民小区的楼房全是一样的,并且按矩阵样式排列.其楼房的编号为1,2,3... 当排满一行时,从下一行相邻的楼往反方向排号. 比如:当小区排号宽度为6时,开始情形如下: 1 2 3 4 ...

  5. Goldbach`s Conjecture(素筛水题)题解

    Goldbach`s Conjecture Goldbach's conjecture is one of the oldest unsolved problems in number theory ...

  6. linux 下 安装nginx

    http://www.cnblogs.com/lovexinyi8/p/5845017.html 测试可用. 参看 https://www.cnblogs.com/liujuncm5/p/671378 ...

  7. 【异常记录(九)】 System.Threading.ThreadAbortException: 正在中止线程

    报错如下: System.Threading.ThreadAbortException: Thread was being aborted. at System.Threading.Thread.Ab ...

  8. POJ 1509 Glass Beads---最小表示法

    题意: T组数据,每组数据给出一个字符串,求这个字符串的最小表示发(只要求输出起始位置坐标) SAM入门题(检测板子是否正确). 将字符串S加倍丢进SAM中,然后走字符串长度次,每次贪心的沿最小的边走 ...

  9. c++ 判断数组元素是否都是奇数(all_of)

    #include <iostream> // std::cout #include <algorithm> // std::all_of #include <array& ...

  10. jq的attr()与prop()之间区别

    1.attr() 一直存在,prop() 仅存在于 jq-1.6 及其之后 2.新版本jq使用细节: 2.1 自定义添加至dom节点的属性,用attr获取 2.2 表单类checked.selecte ...