how to display Chinese characters on Delphi 5.0 (English edition) interface?(100

X

xtra

Unregistered / Unconfirmed
GUEST, unregistred user!
how to display Chinese characters on Delphi 5.0 (English edition) interface?(100分)<br />Hi,
can you give me some ideal on how to display Chinese characters on Delphi 5.0 (English edition) interface?
2. How to use Input Method Editor (IME) in delphi?
thanks in advance.
xtra
 
1. I use Delphi 5 English edition too, no problem,on Win98 and
Win2K chinese edition,just input Chinese characters into TLabel.Caption and
anywhere.
2. All IME APIs are defined in IMM, uses IMM first,then
call it. For example:
 
var bFirstUseIme: Boolean = True;
procedure ToChinese(Handle: THandle;
bChinese: Boolean = True);
var
bActivated: Boolean;
iLastIme: Integer;
begin
bActivated := False;
if bFirstUseIme and bChinese then
begin
iLastIme := Screen.Imes.IndexOf(SysIni.ReadString(seSystem, idLastIme, '五笔型码'));
if iLastIme >= 0 then
begin
ActivateKeyboardLayout(HKL(Screen.Imes.Objects[iLastIme]), 0);
ImeModeSymbolAndNoFullShape(Handle);
bActivated := True;
end;
bFirstUseIme := False;
end;
if not bActivated and
(ImmIsIME(GetKeyboardLayOut(0)) <> bChinese) then
ImmSimulateHotKey(Handle, IME_CHotKey_IME_NonIME_Toggle);
Application.ProcessMessages;
//Make sure the job isdo
ne
//SaveLastIme;
//save user IME
end;

call:
ToChinese(Edit1.Handle);
//改变到用户上次使用的汉字输入法
ToChinese(Edit1.Handle, False);
//改变英文输入
 
Hi qdyoung,
Thanks here!
I tried on my machine (Win2000), it did not work. It showed "???" on the Botton or Labels.
Is it the reason: not Chinese Character Set on my Delphi 5.0?? if yes, what can Ido
?
xtra.
 
both showed "???" in design and run time?
use win2k Chinese edition?
I think it is not Delphi5 problem.
try set
Font.Charset = 'GB2312_CHARSET'
Font.Name = '宋体'
 
Hi qdyoung,
Yes. It showed "??" at both compile and run time.
I use Win 2000 English edition and itdo
support chinese character set.
I will try it. I have to run away now. I will contact to you next time.
Thanks again.
xtra.
 
thanks, qdyyoung.
xtra.
 
顶部