473,388 Members | 1,480 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,388 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 2597
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.