 |
| VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1). |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

March 8th, 2004, 10:22 AM
|
|
Friend of Wrox
|
|
Join Date: Sep 2003
Posts: 130
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hot Keys
Hi
I have put hotkeys into my project and they show with the appropriate letter underlined, however when I press ctrl, alt and that particular letter nothing happens. What I am doing wrong?
Thanks In Advance
Louisa
|
|

March 8th, 2004, 11:46 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi Louisa,
Are you talking about hot keys assigned by putting an ampersand in the screen name of the control, like a button or menu item? If so, try Alt+Letter. AFAIK, you shouldn't use the Ctrl key, unless you use the Shortcut property of a MenuItem. Some of those shortcuts use the Ctrl key.
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

March 9th, 2004, 10:01 AM
|
|
Friend of Wrox
|
|
Join Date: Sep 2003
Posts: 130
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Imar,
Yes I am talking about hotkeys where you put an & in front of the letter you want to become hotkeys. How do I assign what keys will activate which action?
Louisa
|
|

March 9th, 2004, 10:06 AM
|
|
Friend of Wrox
|
|
Join Date: Sep 2003
Posts: 130
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Imar,
I have tried the alt and the hotkey this works great for the top of the menu for example file, but what about within the menu such as save, as this doesn't work.
Louisa
|
|

March 9th, 2004, 10:17 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
For Menu Items, you'll have to assign a Shortcut yourself. Click a Menu Item on the forms designer (make sure you have a Menu Item, not the top-level menu) and then open the Properties dialog. You'll find a Shortcut property that allows you to assign a shortcut like F6 or Ctrl+Shift+W to the menu item. Make sure that ShowShortcut is set to True, so your users are able to see the shortcut.....
I don't think the other "shortcuts", e.g. press Alt+B for a Button with the text &Button are called shortcuts, but rather are called Access Keys (the net effect is the same, though; both allow you to perform an action by pressing keys on your keyboard).
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

March 9th, 2004, 12:26 PM
|
|
Friend of Wrox
|
|
Join Date: Sep 2003
Posts: 130
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks very much, worked perfectly
Louisa
|
|

September 27th, 2004, 09:48 AM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I have assigned hot keys to my application tied to the key down event on a form. However, if there are 40 controls on my form, it's very common that the form does not have focus. Therefore, I can add the same event handler to each control's key down event but that seems extremely tedious. Does anyone have any alternate suggestions?
Ray
|
|
 |