Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. How to change the keyboard layout?

How to change the keyboard layout?

Scheduled Pinned Locked Moved C#
questionjsonhelptutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mic Mathi
    wrote on last edited by
    #1

    How can I convert the keyboard layout to arabic? I could covert the characters using the API 'LoadKeyboardLayout'. But the digits are not converting to arabic. I searched in the net for the API I understand the digits can convert with the function 'SetLocaleInfo'. This function receives 3 arguments but i don't know the value should be passed to this funtions. Please help to find the values of the arguments. Thanks and Regards, Mic

    H 1 Reply Last reply
    0
    • M Mic Mathi

      How can I convert the keyboard layout to arabic? I could covert the characters using the API 'LoadKeyboardLayout'. But the digits are not converting to arabic. I searched in the net for the API I understand the digits can convert with the function 'SetLocaleInfo'. This function receives 3 arguments but i don't know the value should be passed to this funtions. Please help to find the values of the arguments. Thanks and Regards, Mic

      H Offline
      H Offline
      Hessam Jalali
      wrote on last edited by
      #2

      you must use System.Windows.Forms.InputLanguage Class to do this here is an example to change the input language to Farsi

              foreach (InputLanguage lang in InputLanguage.InstalledInputLanguages)
                  if (lang.LayoutName == "Farsi")
                  {
                      InputLanguage.CurrentInputLanguage = lang;
                      break;
                  }
      
      M 1 Reply Last reply
      0
      • H Hessam Jalali

        you must use System.Windows.Forms.InputLanguage Class to do this here is an example to change the input language to Farsi

                foreach (InputLanguage lang in InputLanguage.InstalledInputLanguages)
                    if (lang.LayoutName == "Farsi")
                    {
                        InputLanguage.CurrentInputLanguage = lang;
                        break;
                    }
        
        M Offline
        M Offline
        Mic Mathi
        wrote on last edited by
        #3

        Thanks for your reply. It will change the characters but it is not changing the digits. Thanks and Regards, Mic

        H 1 Reply Last reply
        0
        • M Mic Mathi

          Thanks for your reply. It will change the characters but it is not changing the digits. Thanks and Regards, Mic

          H Offline
          H Offline
          Hessam Jalali
          wrote on last edited by
          #4

          there is no need to use APIs I just change my font to Persian/Arabic font and the numbers was ok (in Persian/Arabic) I used 30 fonts and all of them was ok here is the arabic font pack from microsoft http://www.microsoft.com/downloads/details.aspx?FamilyID=A83C0E03-8913-47A3-ACB7-8AC357627620&displaylang=AR but I didn't test these fonts if you have problem with them and want the tested fonts just tell me:)

          E 1 Reply Last reply
          0
          • H Hessam Jalali

            there is no need to use APIs I just change my font to Persian/Arabic font and the numbers was ok (in Persian/Arabic) I used 30 fonts and all of them was ok here is the arabic font pack from microsoft http://www.microsoft.com/downloads/details.aspx?FamilyID=A83C0E03-8913-47A3-ACB7-8AC357627620&displaylang=AR but I didn't test these fonts if you have problem with them and want the tested fonts just tell me:)

            E Offline
            E Offline
            Elayaraja Sambasivam
            wrote on last edited by
            #5

            use the following statement to change the input language. InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(CultureInfo.CurrentCulture); Regards Elayaraja.S

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups