在edit1控件失去焦点的时候,edit2根据edit1的汉字内容,自动生成第一个拼音字母组成的拼音.
例如:机电 jd
请各位高手帮忙解决!谢谢了!
例如:机电 jd
请各位高手帮忙解决!谢谢了!
解决方案 »
- mdi子窗口如何查找父窗口的句柄并向它发消息?
- 如何在数据库中插入数据
- UDP广播问题,请大家帮忙!
- 用query控件连接远程服务器时为什么提示'table is readonly'
- 天啊~~!为什么在intraweb中用adodataset添加文件到数据库中时,文件的大小只能<=32k:(
- 在quickreport中动态创建QRExpr
- 鸟菜问题!!!!!!!!!!!!!!!!!!!
- delphi高手请进:关于算法转换的问题?100急待!!!
- 怎么在delphi用Winsock发送文件?
- delphi传参调用EXE的问题,急~~~`
- delphi程序出现异常时有什么变量可以记录出错源程序行号吗?
- label 的拖动问题.!!!!!!!!!
function GetPYIndexChar(const sScrStr: string): string;
var
iCount: integer;
sHz, sPYM: string;
begin
iCount := 1;
while iCount <= length(sScrStr) do
begin
sHz := COPY(sScrStr, iCount, 2);
case WORD(sHz[1]) shl 8 + WORD(sHz[2]) of
$B0A1..$B0C4: result := 'A';
$B0C5..$B2C0: result := 'B';
$B2C1..$B4ED: result := 'C';
$B4EE..$B6E9: result := 'D';
$B6EA..$B7A1: result := 'E';
$B7A2..$B8C0: result := 'F';
$B8C1..$B9FD: result := 'G';
$B9FE..$BBF6: result := 'H';
$BBF7..$BFA5: result := 'J';
$BFA6..$C0AB: result := 'K';
$C0AC..$C2E7: result := 'L';
$C2E8..$C4C2: result := 'M';
$C4C3..$C5B5: result := 'N';
$C5B6..$C5BD: result := 'O';
$C5BE..$C6D9: result := 'P';
$C6DA..$C8BA: result := 'Q';
$C8BB..$C8F5: result := 'R';
$C8F6..$CBF9: result := 'S';
$CBFA..$CDD9: result := 'T';
$CDDA..$CEF3: result := 'W';
$CEF4..$D1B8: result := 'X';
$D1B9..$D4D0: result := 'Y';
$D4D1..$D7F9: result := 'Z';
else
result := '';
end;
if Result = '' then
begin
sPYM := sPYM + COPY(sScrStr, iCount, 1);
iCount := iCount + 1;
end
else
begin
sPYM := sPYM + Result;
iCount := iCount + 2;
end;
Result := sPYM;
end; //end While
end;
procedure TForm2.Edit1Change(Sender: TObject);
begin
try
edit6.Text :=GetPYIndexChar(edit1.Text );
except
end;
end;