all groups > dotnet windows forms > january 2005 >
You're in the

dotnet windows forms

group:

menu shortcuts and language changes


menu shortcuts and language changes AndrewEames
1/31/2005 7:41:11 AM
dotnet windows forms:
Here's a tricky problem I just ran into.

1) Install the German language pack of the .NET framework
2)Create a menu bar with a File/New menu item and make the shortcut be
ctrl-N
3) Immediately after the call to InitializeComponent, add the following
code
CultureInfo ci = CultureInfo.CreateSpecificCulture("de-de");
Thread.CurrentThread.CurrentCulture =
Thread.CurrentThread.CurrentUICulture = ci;

Run the app, click on the File Menu and the shortcut is displayed
as "Strg+N" - just perfect

OK, Now remove the code above, add a button to the form and add the code
above to the buttons click event handler. Run the app, click the button
and then when you click on the File Menu, it is displayed as "Ctrl+N"

I am trying to switch languages on the fly - I can get the menu text to
change no problem but I don't seem to be able to get the Shortcuts to
change dynamically (I tried poking at them after switching cultures but
they are still English)- the shortcut translations must be getting cached
somewhere - anyone got any clues?
Andrew
Re: menu shortcuts and language changes alejandro lapeyre
1/31/2005 1:25:08 PM
Maybe... what happens if you rebuild the menu?

"AndrewEames" <AndrewEames@discussions.microsoft.com> escribió en el mensaje
news:E95CE437-BE1F-4D41-885B-EB031F0FDFCC@microsoft.com...
[quoted text, click to view]

AddThis Social Bookmark Button