in a multi language software there are below code to change culture of software :
string culture = ConfigurationManager.AppSettings["culture"].ToString();
Thread.CurrentThread.CurrentCulture = new CultureInfo(culture);
Thread.CurrentThread.CurrentUICulture = new CultureInfo(culture);
the culture key is saved in app.config that hold culture of software, like ar-IQ and etc.
There are a panel object in a windows form, I want to set background image for it based on user culture.
for textual resource there are no problem, text of all labels change based on user culture. but for image resources i always read from one resource and this is a problem, because image must read based on user culture from proper resource file.
for example i have two below resources file for my project images:
- Images.resx
- Images.ar.resx
All images are embedded in this tow resource file.
the are a Login.png in this two resources, i use this code for changing background image of panel object :
pnlLogin.BackgroundImage = Resources.Images.Login;
this code always read Login.png image from Images.resx, i want to read Login.png image from Images.resx when user culture change to ar-IQ.