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:

  1. the easy option close , re-open form;

  2. 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

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -