Change textbox language

Posted on 2003-11-16
Last Modified: 2008-03-03
I would like to know if there is a way to change the language only inside a textbox.
For examble i would like to press a button and the user can insert french characters inside the current textbox.

I tried "ActivateKeyboardLayout", maybe i did something wrong, but it doesn work, is there any other way ?
Question by:CodedK
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3

Expert Comment

ID: 9761636
var russian, latin: HKL;

russian:=LoadKeyboardLayout('00000419', 0);
latin:=LoadKeyboardLayout('00000409', 0);

-- -- -- -- -- in programm--- --- ---

LVL 16

Author Comment

ID: 9763179
Well, this doesnt work... The code goes like this..

procedure TForm5.Image1Click(Sender: TObject);
var Russian: HKL;
Russian:=LoadKeyboardLayout('00000419', 0);

(Compiler message : var Russian never used.)

Maybe that happens because i dont have russian language in my pc. How can i find the # list of the languages ?
LVL 16

Author Comment

ID: 9763199
About  SetActiveKeyboardLayout(russian); ---->
Undeclared identifier... SetActiveKeyboardLayout. Is there something in the uses section ?
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 9763846
it is necessary to declare global. not in procedure !

var Russian: HKL;

Expert Comment

ID: 9763996
Ukrainian 00000422
Russian 00000419
English 00000409
German 00000407
Spanish 00000403
polish 00000415
Romainan 00000418
French 0000040C

Expert Comment

ID: 9764140
//  greater number element array is reserved

TKBLayout = array [0..9] of HKL;
PKBLayout = ^TKBLayout;

n:= GetKeyboardLayoutList(10,KBLayoutList^);  // n - total number real spreading

// Number spreading possible to define so :

   i : integer;
   str : string;
for i:=0 to n-1 do begin


Accepted Solution

13_th earned 40 total points
ID: 9764200
SetActivateKeyboardLayout to ActivateKeyboardLayout, sorry :)

uses windows;
LVL 16

Author Comment

ID: 9768115
Thank you 13th for your quick response. It works fine now.  Though i cant understand your previous code ... i guess it shows a list of the codes. I am new here and in delphi too. I tried to make it work but i make something wrong i think. If you want clear it a little for me please.

I found this codes in a page and i will place it here for anyone having the same question.

Layout Codes
Arabic 00000401
Baltic 00000425
Central European 00000405
Greek 00000408
Hebrew 0000040D
Russian 00000419
Russian transliterated 00040419
Ukrainian 00000422
Ukrainian transliterated 00020422
US 00000409
US Dvorak 00010409
Turkish 0000041F
Western 00020409

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Create Database on Android via Delphi dbExpress 3 129
How to debug For loops? 3 61
how can i search if string exist in array ? 3 69
Firemonkey BASS_Init into a thread 17 55
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question