Windows Develop Bookmark and Share   
 index > Windows Forms General > Localization and the Enabled/Visible Properties (bug?)
 

Localization and the Enabled/Visible Properties (bug?)

Hi,

I've been exploring the Localization features of .net for some time now and noticed that I can configure the Enabled/Visible property of a control per language but when using it, it's kind of bugged. Since .net doesn't provide a way to update the UI to a new culture I'm using following method:

private void changeCulture(string culture)
{
Thread.CurrentThread.CurrentUICulture = new CultureInfo(culture);
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(this.GetType());

foreach(Control control in this.Controls)
{
resources.ApplyResources(control, control.Name);
}
resources.ApplyResources(this, "$this");
}

Works quite well. But as soon as I change to a culture which e.g. sets the Enabled property of a control to false, changing to a culture which has it set to true doesn't enable the control again. I thought the reason for this could be, that the .resx files just include what has _changed_ compared to the fallback culture. So I tried to change to the fallback culture before changing to my desired culture. But once disabled, the control stays like this (except when I explicitly set Enabled to true again). Any ideas what the reason for this could be?

Thanks for any hint!
ctusch  Friday, April 13, 2007 2:03 PM
I think you're on the right track, the .resx file contains property values that are different from the default value. And the default values for Enabled and Visible are both True.
nobugz  Friday, April 13, 2007 3:03 PM
I think you're on the right track, the .resx file contains property values that are different from the default value. And the default values for Enabled and Visible are both True.
nobugz  Friday, April 13, 2007 3:03 PM
Hey, sorry for the late reply. As you said the default values are both True. But why don't the controls get enabled again after I've changed to the default language?
ctusch  Monday, April 16, 2007 7:28 AM

You can use google to search for other answers

Custom Search

More Threads

• Tell where I am wrong or agree with me that it is a bug
• File Handling in vb.net
• Balloon Tooltip for Toolstrip items
• Getting COM error for Webbrowser control
• Some simple questions
• How can I put a combobox in a column of a datagrid?
• Using explicit localiztion with a CreateUserWizard control
• Doesnt change background color of datagridview
• Configuring the wireless network device to work as firewall...
• How to override ScrollToControl?