473,548 Members | 2,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2724
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
1117
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 same way I have to do to capture the contextmenu.click event (AddHandler mnuItem.Click, AddressOf RepriceJob)? Because at present nothing is...
7
6880
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 datasheets (for subforms). I would like to do this on startup of the application. To be clear:
0
1650
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 own click event handlers. When I click on any of the options in the ContextMenu, I want to know which RichTextBox the ContextMenu is currently...
2
2657
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 rolls out The standart code : myMenuItem.Shortcut = Shortcut.CtrlA
2
1198
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
343
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, 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...
1
1413
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? ToolBar.GetChildAtPos() doesn't work as ToolBarButton is not a child control fo a toolbar... I am implementing a sort of Windows Task Bar for my MDI...
11
2647
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 prefer just to tack my MenuItem on to the existing, built-in ContextMenu (Cut, Copy, Paste, etc.): _RemoveMRUItemMenu = New MenuItem...
2
7515
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 the command that you want to run. It's not the most productive or efficient way to get to XP's tools and goodies. That's where desktop shortcuts...
0
7518
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7954
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7467
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7805
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5367
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5085
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1932
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1054
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
755
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.