c# - How to change resources dynamically -
i have window based application in c#. trying language, arabic.
as know there resource file each form. have created global resource file resoucefilename.ar-sa.resx . want alter labels dynamically when alter cultureinfo. if write in designer file like
static class clslocalization { static resourcemanager resmanager = new resourcemanager(typeof(secure_browser_cs_version.properties.resources)); public static void applyglobalresources(control control,string resource) { system.threading.thread.currentthread.currentuiculture = new system.globalization.cultureinfo("ar-sa"); control.text=resmanager.getstring(resource); } } // resource file system.componentmodel.componentresourcemanager resources = new system.componentmodel.componentresourcemanager(typeof(sbmainform));//default // // settinghdrlbl // resources.applyresources(this.settinghdrlbl, "settinghdrlbl"); clslocalization.applyglobalresources(this.settinghdrlbl, "settinghdrlbl"); this.settinghdrlbl.backcolor = system.drawing.color.transparent; this.settinghdrlbl.name = "settinghdrlbl";
this reload default whenever alter in designer file. pl help me out
c#
No comments:
Post a Comment