BCB处理Tab按键事件
来源:互联网 发布:天书残卷太极1到2数据 编辑:程序博客网 时间:2024/04/29 13:48
默认的Edit等控件不能处理Tab按键,只能在Form的OnShortCut事件处理
关于OnShortCut帮助
Use OnShortCut to dispatch shortcut keystrokes before the form handles them. When the user presses a key, the form can dispatch it as a shortcut key instead of allowing the standard keystroke processing (OnKeyDown, OnKeyPress, and OnKeyUp). Built-in shortcut processing is provided for menu shortcuts and actions associated with the form. OnShortCut allows the form to implement additional shortcuts.
If the OnShortCut implements a response to the keystroke, set the Handled parameter of the event handler to true. This prevents the keystroke from being passed on to menus or actions associated with the form. It also prevents the standard keystroke processing in the same way that a menu or action shortcut does.
想让Edit之类控件处理Tab消息的解决办法:
在OnShortCut检测到Tab按键消息返回0(未处理),则Tab按键消息会被发送到相应的控件(默认不发送)
void __fastcall TForm1::FormShortCut(TWMKey &Msg, bool &Handled){ if(Msg.CharCode==VK_TAB) Msg.Result=0; }//---------------------------------------------------------------------------void __fastcall TForm1::Edit1KeyDown(TObject *Sender, WORD &Key, TShiftState Shift){ ShowMessage(Key); }
- BCB处理Tab按键事件
- 让非模态对话框处理TAB按键事件的三种方法
- Javascript 处理 Ctrl+s 和 Tab 按键响应事件
- 对话框处理TAB按键事件的三种方法
- 按键事件的处理
- 按键事件的处理
- Android事件处理--按键
- 按键事件处理
- Java处理按键事件
- 按键事件处理
- QML事件处理--按键处理
- Android+按键事件处理详解
- Android按键事件处理分析 .
- Android 按键事件处理详解
- Android 按键事件处理详解
- Android+按键事件处理详解
- Android按键事件处理分析
- Android+按键事件处理详解
- last_Value函数的使用(SQL SERVER 2012RC)
- 程序学习路线图
- Android系统文件夹结构解析及sd卡文件系统结构
- ASP.NET禁用一部分验证控件,ValidationGroup的设置与使用
- OpenWrt编译教程
- BCB处理Tab按键事件
- python正则表达式学习
- What is a Digital Signature? 数字签名
- JUnit测试一个DAO(ADAO),同时此DAO中调用了另一DAO(BDAO),抛异常
- opencv读取RGB直方图
- 嵌入式系统 Boot Loader 技术内幕
- 有关网页静态化
- Android全屏显示的两种方式
- printf系列详解