G
Guest
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
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