Detecting language bar changes - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Detecting language bar changes

Arie_LArie_L Posts: 1Member
I need to write a program which knows which language is selected in the language bar.

Anybody knows how to do that?

Comments

  • m_karwalm_karwal Posts: 1Member
    You cna do this is C# as follows:

    a) Start a C# Console Applictaion.
    b) Open solution exlorer and add refernce to System.Windows.Forms.
    c) Paste the followng code in the Project Editor.

    using System;
    using System.Globalization;
    using System.Windows.Forms;

    namespace ConsoleApplication1
    {
    class Program
    {
    static void Main(string[] args)
    {
    InputLanguage myDefaultLanguage =
    InputLanguage.DefaultInputLanguage;
    Console.WriteLine("Current input language is now: " +
    myDefaultLanguage.Culture.EnglishName);
    Console.ReadLine();
    }
    }
    }

    d) Compile the code and run it.

    You should be able to see the current input languag selected in the language bar.


Sign In or Register to comment.