Language-Dependent Access and Shortcut Keys in Visual Basic Menus
I'm working on a Visual Basic client designed for international use. Static text, like captions and labels, is handled using a resource file and language-specific DLLs. When a user specifies a language, the current strings are simply read from one of the DLLs at run time. This works fine. But I have a problem with menus. Or actually with accelerator keys assigned to menu items. There seems to be no way to dynamically change the design settings. Please tell me I am wrong.
Still hopeful,
Anders Vikström
Dr. GUI learned in med school that Visual Basic allows you to modify the menu after it's been loaded into the form. What you need to do is access the form's menu object and modify it as described in Chapter 10 of the "Visual Basic Programmer's Guide" in the MSDN Library. As you do this, get the strings for the menu items from your resource DLL. To set up access keys, just put an ampersand (&) in front of the character whose key you want to be an accelerator.
Dr. GUI asked a specialist about shortcut keys. The specialist confirmed that there's no way to modify these except at design time. Sorry about that. Two workarounds that make sense: Do not use shortcut keys at all, or use shortcut keys that make equal sense in all your target languages.