473,327 Members | 2,118 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,327 software developers and data experts.

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 2594
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_SelectedIndexChanged(object sender,
System.EventArgs e)
{
if(this.tabControl1.SelectedTab.Text == "Tab1")
{
this.button1.Text = "&Button1";
this.button2.Text = "Button2";
}
else
{
this.button1.Text = "Button1";
this.button2.Text = "&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******@online.microsoft.com> wrote in message
news:AX**************@cpmsftngxa06.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_SelectedIndexChanged(object sender,
System.EventArgs e)
{
if(this.tabControl1.SelectedTab.Text == "Tab1")
{
this.button1.Text = "&Button1";
this.button2.Text = "Button2";
}
else
{
this.button1.Text = "Button1";
this.button2.Text = "&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
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...
4
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...
5
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...
0
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...
1
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...
2
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...
2
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...
4
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...
2
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.