Click here to Skip to main content
15,896,154 members
Home / Discussions / C#
   

C#

 
QuestionDatabase in oledb Pin
divya shri15-May-14 1:31
divya shri15-May-14 1:31 
AnswerRe: Database in oledb Pin
V.15-May-14 2:35
professionalV.15-May-14 2:35 
SuggestionRe: Database in oledb Pin
thatraja15-May-14 2:55
professionalthatraja15-May-14 2:55 
Questiondll used in C# application in VS2005 works correctly, but didn't work in VS2012. Pin
sreehari_mysore15-May-14 0:39
sreehari_mysore15-May-14 0:39 
AnswerRe: dll used in C# application in VS2005 works correctly, but didn't work in VS2012. Pin
Freak3015-May-14 2:47
Freak3015-May-14 2:47 
GeneralRe: dll used in C# application in VS2005 works correctly, but didn't work in VS2012. Pin
sreehari_mysore15-May-14 5:56
sreehari_mysore15-May-14 5:56 
AnswerRe: dll used in C# application in VS2005 works correctly, but didn't work in VS2012. Pin
Bernhard Hiller15-May-14 21:43
Bernhard Hiller15-May-14 21:43 
QuestionCreating Multilingual app in C#.net Pin
diwesh14-May-14 15:06
diwesh14-May-14 15:06 
My application is made only in English and i want to switch it to multilingual version . But instead of user changing default language in regionaal settings i gave my application a "ToolStripMenuItem" called langauge and added a submenu for Arabic , Korean and English version .

As far i am aware three things are required -:
1.Writing a code in click event of that Langauage subemenu say "Arabic"
2.Creating a corresponding resx file
3.Also i had set the Form localizable property to "True"

This is the code i added to my Program in Form1()
//this variable indicates the current language in use
    CultureInfo CurrentLocale;

    public Form1()
    {
        InitializeComponent();
        valueInit();
        //MessageBox.Show(rfidCard.PORT + "");
    }


    //Lets start adding the multilingual code here




    //change the language in real time 
    private void ChangeLanguage(string lang)
    {
        CurrentLocale = new CultureInfo(lang);
        foreach (Control c in this.Controls)
        {
            ComponentResourceManager resources = new ComponentResourceManager(typeof(Form1));
            resources.ApplyResources(c, "$this");
            RefreshResources(this, resources);
        }
    }

    //refresh all the controls e sub-controls of the form 
    private void RefreshResources(Control ctrl, ComponentResourceManager res)
    {
        ctrl.SuspendLayout();
        res.ApplyResources(ctrl, ctrl.Name, CurrentLocale);
        foreach (Control control in ctrl.Controls)
            RefreshResources(control, res); // recursion
        ctrl.ResumeLayout(false);
    }

    private void englishToolStripMenuItem_Click(object sender, EventArgs e)
    {
        ChangeLanguage("en-US");
    }

    private void arabicToolStripMenuItem_Click(object sender, EventArgs e)
    {
        ChangeLanguage("ar-SA");
    }

    private void koreanToolStripMenuItem_Click(object sender, EventArgs e)
    {
        ChangeLanguage("ko-KR");
    }

    // the code ends here


Second i added a resx file called Form1.ar-SA.resx and Form1.kr-KO.resx


However when i run my application and try clicking on language Arabic it still does not change anything .

can someone please help me to find where i went wrong or what am i missing ?
diwesh saxena

AnswerRe: Creating Multilingual app in C#.net Pin
Bernhard Hiller14-May-14 21:26
Bernhard Hiller14-May-14 21:26 
AnswerRe: Creating Multilingual app in C#.net Pin
diwesh14-May-14 21:31
diwesh14-May-14 21:31 
QuestionWeird Issue With Web Service Pin
SledgeHammer0114-May-14 7:36
SledgeHammer0114-May-14 7:36 
AnswerRe: Weird Issue With Web Service Pin
Kornfeld Eliyahu Peter14-May-14 10:11
professionalKornfeld Eliyahu Peter14-May-14 10:11 
GeneralRe: Weird Issue With Web Service Pin
SledgeHammer0114-May-14 11:08
SledgeHammer0114-May-14 11:08 
AnswerRe: Weird Issue With Web Service Pin
Kornfeld Eliyahu Peter14-May-14 19:14
professionalKornfeld Eliyahu Peter14-May-14 19:14 
GeneralRe: Weird Issue With Web Service Pin
SledgeHammer0114-May-14 19:25
SledgeHammer0114-May-14 19:25 
AnswerRe: Weird Issue With Web Service Pin
Kornfeld Eliyahu Peter14-May-14 19:37
professionalKornfeld Eliyahu Peter14-May-14 19:37 
AnswerRe: Weird Issue With Web Service Pin
Bernhard Hiller14-May-14 21:36
Bernhard Hiller14-May-14 21:36 
GeneralRe: Weird Issue With Web Service Pin
SledgeHammer0115-May-14 7:12
SledgeHammer0115-May-14 7:12 
GeneralRe: Weird Issue With Web Service Pin
Eddy Vluggen15-May-14 8:20
professionalEddy Vluggen15-May-14 8:20 
GeneralRe: Weird Issue With Web Service Pin
Bernhard Hiller15-May-14 20:54
Bernhard Hiller15-May-14 20:54 
Questionupdate command SQL CE in C# Pin
Lubomír Baloga14-May-14 3:11
Lubomír Baloga14-May-14 3:11 
AnswerRe: update command SQL CE in C# Pin
Eddy Vluggen14-May-14 3:14
professionalEddy Vluggen14-May-14 3:14 
QuestionLoading 3D model from file Pin
MrDooDoo13-May-14 10:32
MrDooDoo13-May-14 10:32 
AnswerRe: Loading 3D model from file Pin
Pete O'Hanlon14-May-14 1:45
mvePete O'Hanlon14-May-14 1:45 
AnswerRe: Loading 3D model from file Pin
Terry Tyson15-May-14 4:18
Terry Tyson15-May-14 4:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.