Solved

Change textbox language

Posted on 2003-11-16
8
1,191 Views
Last Modified: 2008-03-03
Hi.
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 ?
0
Comment
Question by:CodedK
  • 5
  • 3
8 Comments
 

Expert Comment

by:13_th
ID: 9761636
var russian, latin: HKL;

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

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

SetActiveKeyboardLayout(russian);
0
 
LVL 16

Author Comment

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

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

(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 ?
0
 
LVL 16

Author Comment

by:CodedK
ID: 9763199
About  SetActiveKeyboardLayout(russian); ---->
Undeclared identifier... SetActiveKeyboardLayout. Is there something in the uses section ?
0
 

Expert Comment

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

var Russian: HKL;
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Expert Comment

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

Expert Comment

by:13_th
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 :

var
   i : integer;
   str : string;
SetLength(str,200);
for i:=0 to n-1 do begin
  ActivateKeyboardLayout(KBLayoutList^[i],0);
  GetKeyboardLayoutName(PChar(str));          
  showmessage(str);
end;

0
 

Accepted Solution

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

uses windows;
0
 
LVL 16

Author Comment

by:CodedK
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
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now