开发者

Create keyboard short-cuts for Toolbar Control in VB6

In my VB6 project, I'm using only Toolbar Control in main MDI From (Not menubar), The Toolbar has big pictures denoting actions like New, Save, View, Help etc. I wanted to know if there is any way to create keyboard short-cut for these actions. As far as I know, properties of Toolbar control of MS Windows Common Controls 6.0 isn't showing any relative option to do this. As MDI form doesn'开发者_运维问答t have any key events, I can't create short-cuts by associating keys as well. I don't want menu bar in my form as it has very few items so only Toolbar makes the job. Please suggest any idea to have short-cuts for toolbar buttons...... :-| Thanks in advance.............


One way is to use a local WH_KEYBOARD hook, this article explains how (and provides a library).


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()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜