473,382 Members | 1,180 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Shortcuts with ContextMenu and toolbar

I have a MDI windows forms application that uses a toolbar on the parent
form. I've also setup a context menu on this form to be used as the dropdown
menu for one of the toolbar buttons. However, the shortcut keys for the
context menu do not seem to work for the menus, only clicking on them. Is it
possible to use shortcuts this way, or will shortcuts only work with a
MainMenu? Thanks in advance, Ben
Jul 21 '05 #1
4 2701
Shortcut-keys normally work for context menus as well. How are you creating
the context menu?

Regards, Jakob.
"blabore" wrote:
I have a MDI windows forms application that uses a toolbar on the parent
form. I've also setup a context menu on this form to be used as the dropdown
menu for one of the toolbar buttons. However, the shortcut keys for the
context menu do not seem to work for the menus, only clicking on them. Is it
possible to use shortcuts this way, or will shortcuts only work with a
MainMenu? Thanks in advance, Ben

Jul 21 '05 #2
Jakob,

Thanks for the response. I created the context menu through the form
designer, and also assigned the keyboard shortcuts at that time. My guess is
that this has something to do with using an MDI app, and the Main form isn't
"seeing" when the shortcut is pressed. Any ideas? I'm going to try and create
a sample app to see if I can reproduce the exact problem. Thanks again, Ben

"Jakob Christensen" wrote:
Shortcut-keys normally work for context menus as well. How are you creating
the context menu?

Regards, Jakob.
"blabore" wrote:
I have a MDI windows forms application that uses a toolbar on the parent
form. I've also setup a context menu on this form to be used as the dropdown
menu for one of the toolbar buttons. However, the shortcut keys for the
context menu do not seem to work for the menus, only clicking on them. Is it
possible to use shortcuts this way, or will shortcuts only work with a
MainMenu? Thanks in advance, Ben

Jul 21 '05 #3
Ben,

I tried creating a toolbar with a context menu for the main form of an MDI
application and your are right - shortcuts do not work. I found a simple
workaround though. It's not very elegant but it works. If you create a
hidden main menu for the form which has the same event handlers and the same
shortcuts as the context menu, then it works fine.

HTH, Jakob.
"blabore" wrote:
Jakob,

Thanks for the response. I created the context menu through the form
designer, and also assigned the keyboard shortcuts at that time. My guess is
that this has something to do with using an MDI app, and the Main form isn't
"seeing" when the shortcut is pressed. Any ideas? I'm going to try and create
a sample app to see if I can reproduce the exact problem. Thanks again, Ben

"Jakob Christensen" wrote:
Shortcut-keys normally work for context menus as well. How are you creating
the context menu?

Regards, Jakob.
"blabore" wrote:
I have a MDI windows forms application that uses a toolbar on the parent
form. I've also setup a context menu on this form to be used as the dropdown
menu for one of the toolbar buttons. However, the shortcut keys for the
context menu do not seem to work for the menus, only clicking on them. Is it
possible to use shortcuts this way, or will shortcuts only work with a
MainMenu? Thanks in advance, Ben

Jul 21 '05 #4
Jakob,

Thanks again. I think your solution is the way to go. -Ben

"Jakob Christensen" wrote:
Ben,

I tried creating a toolbar with a context menu for the main form of an MDI
application and your are right - shortcuts do not work. I found a simple
workaround though. It's not very elegant but it works. If you create a
hidden main menu for the form which has the same event handlers and the same
shortcuts as the context menu, then it works fine.

HTH, Jakob.
"blabore" wrote:
Jakob,

Thanks for the response. I created the context menu through the form
designer, and also assigned the keyboard shortcuts at that time. My guess is
that this has something to do with using an MDI app, and the Main form isn't
"seeing" when the shortcut is pressed. Any ideas? I'm going to try and create
a sample app to see if I can reproduce the exact problem. Thanks again, Ben

"Jakob Christensen" wrote:
Shortcut-keys normally work for context menus as well. How are you creating
the context menu?

Regards, Jakob.
"blabore" wrote:

> I have a MDI windows forms application that uses a toolbar on the parent
> form. I've also setup a context menu on this form to be used as the dropdown
> menu for one of the toolbar buttons. However, the shortcut keys for the
> context menu do not seem to work for the menus, only clicking on them. Is it
> possible to use shortcuts this way, or will shortcuts only work with a
> MainMenu? Thanks in advance, Ben

Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Supa Hoopsa | last post by:
I have assigned a contextmenu to a datagrid in my WINDOWS application and I want to use keyboard shortcuts. I have assigned a shortcut - lets say ctrlV - but do I need to assign a handler in the...
7
by: cefrancke | last post by:
I cant seem to find a straight answer on the following. I want to programmatically hide all menus except a basic custom report menu (during report preview) and right click pop-up A-Z sorting on...
0
by: MD | last post by:
I have a ContextMenu that is assigned to 3 RichTextBox's (i.e., if you right-click on any of the 3 RichTextBox's, you get the same ContextMenu). My ContextMenu has 2 items, each of which have their...
2
by: Brano | last post by:
Hi all, I have this problem I have a menu structure in my VB.NET application that is about 4 levels deep. I need an CTRL+key access to the 3rd level so that if user press CTRL+key the 3rd menu...
2
by: lottoman | last post by:
Hi all, Is it possible to define shortcuts for toolbarbuttons? Can I also get the underscore underneath the specified letter? Thanks
4
by: blabore | last post by:
I have a MDI windows forms application that uses a toolbar on the parent form. I've also setup a context menu on this form to be used as the dropdown menu for one of the toolbar buttons. However,...
1
by: MuZZy | last post by:
Hi, The problem i have is to show a ContextMenu on a toolbar depending on which ToolBarButton is currently under cursor. Is there any way to find out which ToolBarButton mouse is pointing?...
11
by: Graham Charles | last post by:
I'm writing a control inheriting from ComboBox, and I'd like to add an entry to the ContextMenu for that combo box. I have no problem if I create an entirely new ContextMenu from scratch, but I'd...
2
bartonc
by: bartonc | last post by:
There are many applets and other goodies on Windows that must be run by using a command: The normal way to access these tools is to go to the Start menu and click Run. Then type in the name of...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.