winforms - Facing problem in initialization of components in C# -
i student c# programmer. learning localization , globalization. created button change current culture (currentculture , currentuiculture) of current thread. after running program button not working need. button click event written below:
private void btnlocalized_click(object sender, eventargs e) { cultureinfo ci = new cultureinfo("hi-in"); if (thread.currentthread.currentculture != ci) { thread.currentthread.currentculture = ci; thread.currentthread.currentuiculture = ci; } else { ci = new cultureinfo("en-in"); thread.currentthread.currentculture = ci; thread.currentthread.currentuiculture = ci; } }
i tried calling initializecomponent()
method after else block. create button component without dispossing current button.
how can re-initialized button
edit:
want change text
properties current local language set bt application.
the labels of form set when form created , not automatically updated.
there 2 options:
the easy option close , re-open form;
the difficult option manually update labels of controls of form. if in "designer.cs" of form, can see how labels set. can duplicate such mechanism yourself.
i go option 1.
Comments
Post a Comment