procedure TFormSocket.Button1Click(Sender: TObject);
begin
if Length(WideString(Edit1.Text)) * 2 = Length(Edit1.Text) then
ShowMessage('全是多字节字符'); //包括全角标点
end;
begin
if Length(WideString(Edit1.Text)) * 2 = Length(Edit1.Text) then
ShowMessage('全是多字节字符'); //包括全角标点
end;
在edit1的Onkeypress
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if ord(key)>126 then//因为ascii大于126就不是普通的字符了
showmessage('do');
label1.Caption:=inttostr(ord(key));
end;
你所提供的线索也太少了吧!
请把你要达到的目的阐述清楚
请提供输入、输出范例
如果调试不成功,请给出用于调试的代码
我要的也不难,有一个TEDIT,输入用户的姓名,指定只能为汉字,但是如果用 Drate(小虫) 的方法,则我可以用CTRL+V的方式输入字母,而用 zswang(伴水)的方法又有全角字符,我想有更实用的方法。