(trimmed to appropriate groups)
You could use RegisterHotKey ... see
Specify MOD_CONTROL as the modifier, and 187 for the + sign, and 189 for the
minus, ie ...
Call RegisterHotKey(Me.hWnd, GlobalAtom.Value, MOD_CONTROL, 187)
Call RegisterHotKey(Me.hWnd, GlobalAtom.Value, MOD_CONTROL, 189)
You'll need to do some additional work as the demo only shows trapping a
single hotkey. Also notice that this installs a system-wide hotkey, so
pressing CTRL +/- while in another app will invoke the code in your app.
Therefore you may want to add additional code to deregister the keys when
focus moves from your app to another (
There is also SetMenuItemInfo() and set
CreateAcceleratorTable/DestroyAcceleratorTable that provides for modifying
the text and adding menu/keyboard accellerators to an app ... but I don't
have demos for those (try searching www.codehound.com/vb/ )
MVP Visual Basic
Please respond only to the newsgroups so all can benefit.
> I wanted to add Ctrl + + (Plus sign) in the shortcut for Zooming In and
> Ctrl + - (Minus sign) in the shortcut for Zooming Out for a form in the
> menu Item. The menu editor does not support Plus/Minus sign. If any one
> can help, please let me know.
> Rupesh Kokal.