I’m working on project in which most of the modules are using some common forms. So, I’m planning to keep the major changes in the separate resource files making that form localizable and using different languages for major changes that I can have the code part same and only have to work in the designer file.
The form is calling using the Assembly.CreateInstance method. Though I didn’t succeed, I noticed that there is an option to pass the CultureInfo in the CreateInstance method.
myAssembly.CreateInstance("Facts.Forms." + strSomeFormName ,true
,BindingFlags.Default, null, null,
new System.Globalization.CultureInfo("en-ZW"), null);
Am I missing something? Is there any way to implement this?
No, that’s not what the CultureInfo argument does in that call. It is only used for the args argument when types need to be converted. From a string to a double for example, a conversion that is culture sensitive. It has no effect at all in your case since you passed null for that argument.
Winforms only pays attention to the Thread.CurrentThread.CurrentUICulture property to select the satellite assembly that contains localized resources. You could assign it before making this call.