发现,主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. C# MD5一句话加密

    System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5")

  2. SpringBoot中使用mybatis-generator自动生产

    步骤: 1.在pom.xml中添加插件配置 <plugin> <groupId>org.mybatis.generator</groupId> <artifa ...

  3. vs2010中自动给函数或者类加上注释宏模板

    Sub AddFunComment() Dim DocSel As EnvDTE.TextSelection DocSel = DTE.ActiveDocument.Selection DocSel. ...

  4. NetMagic Simple Overview

    参考: NetMagic Startup: How to develop NetMagic rapidly NetMagic Simple Overview NetMagic 是什么? NetMagi ...

  5. jdk、tomcat、solr环境搭建

    环境概述 1)操作系统:windows7旗舰版(64位) 2)jdk:jdk-8u131-windows-x64: 3)tomcat:apache-tomcat-9.0.0.M21 4)solr:so ...

  6. 用python生成器实现杨辉三角

    先看杨辉三角的形态: 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 上学的时候大多是用c语言的两层for循环在实现,现在我们尝试用生成器来实现. 先说思路:我 ...

  7. 关于react native的快捷键和常用规范

    一:快捷键 1.让其自更新----shift+cmd+z 选择热更新 2.cmd+r ---重新刷新 3 二:常用规范: 1.文件也是一种组件 所以应该命名规则和组件名的命名规则相同  -----使用 ...

  8. PHP生成缩略图的一个方法类(转)

    //使用如下类就可以生成图片缩略图 class resizeimage { //图片类型 var $type; //实际宽度 var $width; //实际高度 var $height; //改变后 ...

  9. JavaScript的知识基本介绍

    ECMAScript js简单介绍(与java的区别)        1.语法(区分大小写,弱类型,分号可写可不写)        2.变量(只能使用var定义,要么不定义,如果在函数内部使用var定 ...

  10. 3-20 标准库:find库; 学习编程语言3节课(大多是旧识,全*栈)3-21 面向对象. Percent Strings; 元编程和Rails的相互理解

    Find The Find module supports the top-down traversal of a set of file paths.(一系列文件的路径的遍历) find(*path ...