Change textbox language

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 ?
LVL 16
CodedKSenior Software EngineerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

var russian, latin: HKL;

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

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

CodedKSenior Software EngineerAuthor Commented:
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 ?
CodedKSenior Software EngineerAuthor Commented:
About  SetActiveKeyboardLayout(russian); ---->
Undeclared identifier... SetActiveKeyboardLayout. Is there something in the uses section ?
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

it is necessary to declare global. not in procedure !

var Russian: HKL;
Ukrainian 00000422
Russian 00000419
English 00000409
German 00000407
Spanish 00000403
polish 00000415
Romainan 00000418
French 0000040C
//  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

SetActivateKeyboardLayout to ActivateKeyboardLayout, sorry :)

uses windows;

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CodedKSenior Software EngineerAuthor Commented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.