Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / January 2005

Tip: Looking for answers? Try searching our database.

menu shortcuts and language changes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
AndrewEames - 31 Jan 2005 15:41 GMT
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
alejandro lapeyre - 31 Jan 2005 16:25 GMT
Maybe... what happens if you rebuild the menu?

> Here's a tricky problem I just ran into.
>
[quoted text clipped - 20 lines]
> somewhere - anyone got any clues?
>  Andrew

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.