Windows Develop Bookmark and Share   
 index > Windows Forms General > Localization and lost font and backgroundimage settings
 

Localization and lost font and backgroundimage settings

Hello,

I have problem with localization, where I don't know, whether it is a bug in Visual C# 2005 or whether I have done something wrong (I'm using the non-localized version of Visual C# 2005 with a german XP Pro).

To reproduce the problem, do the following:

1. Create a new Visual C# !!class library!! project.
2. Add a form (Form1) to the project.
3. Change the font of the form to Arial, Size 15.
4. Add a button (button1) to the form.
5. Change button1.modifier from "private" to "protected".
6. Build the project.
7. Add a second form (Form2), which is inherited from Form1, to the project.
8. Build the project.
9. Change Form2.Localizable form "false" to "true".
10. Change Form2.Language from "(Default)" to"English(UnitedKingdom)".
11. Rebuild the project.
12. Change Form2.Language back from "English(UnitedKingdom)" to "(Default)".

Now, as you can see on the button, the font of Form2 has changed to Microsoft Sans Serif; 8,25pt. If I had a backgroundimage on Form2, it would havebeendisappeared. This is caused by thefollowinglines inthefileForm2.Designer.cs:
//
// Form2
//
resources.ApplyResources( this, "$this" );
this.BackgroundImage = null; <---
this.Font = null; <---
this.Icon = null;
this.Name = "Form2"

Is this intended or a bug? If it is intended, what do I have to do, that the font setting is not changed by Visual C#?

Thanks in advance,
Jens.


Jemu  Wednesday, November 28, 2007 8:31 AM

Hi, Jemu,

Thanks for your feedback. I tried your steps and I have to admit that the behavior is less desirable.

I think this issue may caused by the code generator in Visual Studio (This issue occurs in Visual Studio 2008 as well.), and the workaround for now is to change the settings manually.

You canpost your suggestions for this issueto our Connect feedback portal. Our developer will evaluate them seriously and take them into consideration when designing future release of the product.
http://connect.microsoft.com/VisualStudio/
Improving the quality of our products and services is a never ending process for Microsoft .

Thanks again.

Yu Guo â€?MSFT  Monday, December 03, 2007 6:21 AM

Amendment:

If you change the text of button1 in step 12, instead of changing Form2.Language, and then rebuild the project, the described behaviour also happens.

Jemu  Wednesday, November 28, 2007 8:57 AM

Hi, Jemu,

Thanks for your feedback. I tried your steps and I have to admit that the behavior is less desirable.

I think this issue may caused by the code generator in Visual Studio (This issue occurs in Visual Studio 2008 as well.), and the workaround for now is to change the settings manually.

You canpost your suggestions for this issueto our Connect feedback portal. Our developer will evaluate them seriously and take them into consideration when designing future release of the product.
http://connect.microsoft.com/VisualStudio/
Improving the quality of our products and services is a never ending process for Microsoft .

Thanks again.

Yu Guo â€?MSFT  Monday, December 03, 2007 6:21 AM
This is still an issue as of 09/24/2009 using VS 2008. Describing this behavior as "less desirable" is an understatement. We have an application with over 40 forms that all inherit from a set of base forms and localizing this solution is a nightmare.

Is there a fix for this yet? You mention changing the settings manually but provide no details as to how to accomplish that task. Could you please provide a detailed explanation of the workaround so that we may at least make progress on out task?


http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=281046

Thanks

Brian DeJong
bdejong_cree  Thursday, September 24, 2009 5:36 PM

You can use google to search for other answers

Custom Search

More Threads

• chiled forms and parent form
• windows forms: Cretaing regions and invalidating
• How big a System.Windows.Forms.PictureBox can be?
• A generic error occurred in GDI+. while saving
• closing a form with a button
• problem looping through HtmlWindow Frameset
• Drawing Image with SRCAND
• main form losing responsiveness
• Changing the font of a String*
• passing information