哪位高手可以指教一下?

解决方案 »

  1.   

    function IsCHNString(Text: String): Boolean
    var
      wText: WideString;
      aCh: String;
      i:Integer;
    begin
      wText := Text;
      for i := 1 to Length(wText) do
      begin
        aCh := wText(i);
        if Length(aCh)<2 then
        begin
          result := false;
          exit;
        end;
      end;
      result := true;
    end;
      

  2.   

    var
    s:string;
    i:integer;begin
    s:=Edit1.text;
    for i:=1 to length(s) do
    if (i mod 2=1) and (ord(s[i])<127) then 
    begin
    showmessage('你输入的是英文!');
    break;
    end;
      

  3.   

    在keypress里添加代码如下:
    if (Key in ['0'..'9','a'..'z','A'..'Z',chr(8)]) then
    begin
      Key := #0;
      Windows.beep(800,200); //报警
    end;其它同理。。
      

  4.   

    不好意思,去掉chr(8),这个是退格键。。呵呵