I need to show an demo of how the control can be localized using the satellite assemblies. While doing this I have stuck with one place where i have two controls on a form both are same. I used to derive it from the Label.
Now I need to display the control1
with culture fr-FR
and control2
with the culture de-DE
.
Is there any options is available to set different cultures for the same controls that displayed in a form.
The following screenshot will show my need.
Please suggest me is that possible or not. If its possible, let me know how can I achieve this.
You can rely on localization feature of windows forms. This way you can setup your controls with different properties for different cultures. Then you can show the whole form with properties set for a specific culture.
Also you have option to show each control with a different culture. To do so it's enough to use such code in your form
Load
event handler:And simply for
button2
use above code withde-DE
culture.Note
Above solution is not limited to
Text
property, it supports allLocalizable
properties.You can simply make it as an extension method for control class.
It has designer-support for creating localized appearance of your controls.