4

在我的 VB6 项目中,我在主 MDI 中仅使用工具栏控件(不是菜单栏),工具栏有大图片表示新建、保存、查看、帮助等操作。我想知道是否有任何方法可以创建键盘这些操作的捷径。据我所知,MS Windows Common Controls 6.0 的工具栏控件的属性没有显示任何相关选项来执行此操作。由于 MDI 表单没有任何键事件,因此我也无法通过关联键来创建快捷方式。我不希望我的表单中有菜单栏,因为它的项目很少,所以只有工具栏才能完成这项工作。请提出任何想法来为工具栏按钮设置快捷方式...... :-| 提前致谢.............

4

2 回答 2

0

Add a key event to your form. You could then process the short cuts by having them call the same function that would have been called on the mouse down event for the menubar.

For example you might have something like

public sub SaveItem_Clicked()
  DoSave()
end sub 

Then in your keypress check for Alt+S etc, and have it call DoSave()

于 2010-08-09T17:17:05.397 回答
0

一种方法是使用本地WH_KEYBOARD挂钩,本文解释了如何(并提供了一个库)。

于 2010-08-10T10:46:13.927 回答