473,671 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

accelerator keys

Is there a way to duplicate the accelerator key for
controls which live on separate pages of a tab control.
i.e. to have a button called &Button1 on one tab and
another button called &Button2 on another tab, both
buttons have Alt-B as their accelerator?
Jul 19 '05 #1
2 2632
Hi Richard,

Thanks for your post.

Based on my experience and research, an accelerator key can only be mapped
to a control, other controls with the same accelerator will not take
effect. To work around this problem, I suggest that you can dynamically
chage the Text of the controls. Please refer to the following code snippet:

//-------------code snippet--------------------
private void tabControl1_Sel ectedIndexChang ed(object sender,
System.EventArg s e)
{
if(this.tabCont rol1.SelectedTa b.Text == "Tab1")
{
this.button1.Te xt = "&Button1";
this.button2.Te xt = "Button2";
}
else
{
this.button1.Te xt = "Button1";
this.button2.Te xt = "&Button2";
}
}
//---------------end of----------------------------

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! ¨C www.microsoft.com/security
This posting is provided ¡°as is¡± with no warranties and confers no rights.

Jul 19 '05 #2
Maybe this could be looked at as a feature request for future versions. It
would seem a reasonable thing to do - ignore invisible accelerators.

"Tian Min Huang" <ti******@onlin e.microsoft.com > wrote in message
news:AX******** ******@cpmsftng xa06.phx.gbl...
Hi Richard,

Thanks for your post.

Based on my experience and research, an accelerator key can only be mapped
to a control, other controls with the same accelerator will not take
effect. To work around this problem, I suggest that you can dynamically
chage the Text of the controls. Please refer to the following code snippet:
//-------------code snippet--------------------
private void tabControl1_Sel ectedIndexChang ed(object sender,
System.EventArg s e)
{
if(this.tabCont rol1.SelectedTa b.Text == "Tab1")
{
this.button1.Te xt = "&Button1";
this.button2.Te xt = "Button2";
}
else
{
this.button1.Te xt = "Button1";
this.button2.Te xt = "&Button2";
}
}
//---------------end of----------------------------

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! ¨C www.microsoft.com/security
This posting is provided ¡°as is¡± with no warranties and confers no rights.

Jul 21 '05 #3

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

Similar topics

1
2352
by: BruceR | last post by:
I have created an Outlook style bar in my C# application and have associated accelerator keys to my group/icon buttons by using the & key and setting UseMnemonic as appropriate. The problem is that the buttons are being selected even when I do not press the Alt key. Simply pressing the shortcut key alone without Alt selects the button. This is not the desired effect - I wish to make it so that the user must press the Alt in association...
4
1845
by: Roberto\(DOTNET\) | last post by:
Hi at all, i made a webapplication, and some pages have into its some dynamic control (UserControl). Now i would like to put some accelerator key to improve the fast of some operations. Is there a way in vbnet to make a combination of keys so the user is, for example, on a webpage and press the key '!' and jump into an other particular webpage? roberto
5
2428
by: Rich | last post by:
I typed &myBtn to display the underscore line on the first letter of <u>M</u> of myBtn. I can invoke &myBtn by pressing alt-m on the keyboard. But the underscore is not showing up. Is there a form property I need to set? How can I make the underscore line show up? Thanks, Rich
0
239
by: Richard | last post by:
Is there a way to duplicate the accelerator key for controls which live on separate pages of a tab control. i.e. to have a button called &Button1 on one tab and another button called &Button2 on another tab, both buttons have Alt-B as their accelerator?
1
3474
by: Csaba Gabor | last post by:
Short version: if the user types an alt+ctrl+char combination which leads to a defined character, but s/he's not in a input(text)/textarea, then I'd like that keystroke combination to do the same action that it would have done had there not been a defined character. Longer explanation: I've got a US keyboard and a pseudo Hungarian/German keyboard (I combined them). The extra keys on the European keyboard are entered via alt+ctrl+char...
2
2519
by: Richard Lewis Haggard | last post by:
How does one specify the Escape key as an accelerator? My client has specified that the Escape key be used as an accelerator for a particular menu item. In VS05's designer mode, this particular key is not available as an option to select from the menu item's properties ShortcutKeys item. "No problem," says I to myself (I talk to myself. It's the only way I can have an intelligent conversation around here. Or at least a coherent one, but...
2
2413
by: B. | last post by:
I have a C# winform with accelerator key associated with some menus. If my exe is in unmanaged C++ and the winform is invoked through interop, the accelerator key not working. If I create a new C#.Net project and the same winform is invoked in the C#.Net project, the accelerator key works perfect. Does anyone know what special thing I need to invoke accelerator key if winform is invoked through Interop. Thanks a lot.
4
1870
by: ayan4u | last post by:
ok i have a main window hWnd and created an edit dialogue box as a child window(gEditBox) i have an acclerator table to access the menu items in hWnd when i am in the edit box nothing happens if I use the key combinations for my menu items but when my focus is in the main window i.e., my caret is NOT blinkin in the edit box window , the key combinations are working. Is it that the accelerator keys are not translated and dispatched...
2
3219
by: killy971 | last post by:
I have been testing different libraries to process XSL transformations on large XML files. The fact is that I read a document from Intel, stating their library (XSLT accelerator) was more twice faster than Apache Xalan, and was designed to perform well on large XML files. - http://isdlibrary.intel-dispatch.com/isd/10/wp_XSLT.PDF - http://www.intel.com/cd/software/products/asmo-na/eng/366637.htm Please note that their benchmark was only...
0
8914
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8820
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7433
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6223
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5695
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4224
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2810
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
2
1809
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.