المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Testing Localized Form (Debug vs non-Debug)



C# Programming
05-28-2009, 04:12 AM
I have a localized form set up with default, en-CA and fr-CA ********s. I tried testing the form, for each of the ********s by changing the HKCU\Software\Policies\Microsoft\Control Panel\Desktop\MultiUI********ID value between 0409 (en-US), 1009 (en-CA) and 0C0C (fr-CA). The correct localized text is displayed everytime I test the form without debugging but not when I test using VS debugger.

Here's what I do:
1. Create a localized form with a button which closes the form.
2. Update HKCU\Software\Policies\Microsoft\Control Panel\Desktop\MultiUI********ID value to 0C0C (was originally 0409)
3. From Visual Studio IDE window, choose "Start without Debugging"
4. Form displays with French text as expected
5. Update HKCU\Software\Policies\Microsoft\Control Panel\Desktop\MultiUI********ID value to 1009
6. From Visual Studio IDE window, choose "Start without Debugging"
7. Form now displays with Canadian English text - again, as expected
8. Update HKCU\Software\Policies\Microsoft\Control Panel\Desktop\MultiUI********ID value back to 0C0C
9. From Visual Studio IDE window, choose "Start Debugging"
10. Form displays with Canadian English text - expected to be French
11. Repeat step 9 above - without touching the registry value (still 0C0C)
12. Form now displays in French as expected

I noticed that if I want the form to display in the correct ********, in debug mode, I need to run it twice after changing the registry value.

I test by changing HKCU\Software\Policies\Microsoft\Control Panel\Desktop\MultiUI********ID value because I don't want to change locale in Control Panel everytime. Is this test valid? If so, does anyone know why my test results are different between "Debug" and 'non-Debug"?

Thank you.

cpl