想找个类似于DBCOMBOBOX的东东,但当用户开始输入时,他可以根据用户输入的前面几个字符自动搜索下来框中是否有匹配,并能弹出下拉框。类似的功能再其他应用软件中见得多了,我也想给我的软件加上这个功能!

解决方案 »

  1.   

    些函数可用。呵呵。
    procedure SearchByPYIndexStr(Const SourceStrs:TStringList;Const PYIndexStr:string;Const IType:Integer; Box:TListBox);
    label NotFound;
    var
      i, j   :integer;
      hzchar :string;
    begin
      box.Items.Clear;
      for i:=0 to SourceStrs.Count-1 do
        begin
          for j:=1 to Length(PYIndexStr) do
            begin
              if Length(SourceStrs[i])=0 then goto NotFound;
              hzchar:=SourceStrs[i][j];
              if PYIndexStr[j] <> hzchar
              then goto NotFound;
            end;
            if (IType=0)or((IType=1)and(codes[integer(sourcestrs.Objects[i])][1]='*'))or((IType=2)and(codes[integer(sourcestrs.Objects[i])][1]='^')) then
             box.Items.Addobject(SourceStrs[i],sourcestrs.Objects[i]);
    NotFound:
        end;
    end;
      

  2.   

    netlib(河外孤星) 对中文也可以吗?
      

  3.   

    要不直接到delphi深度历险下载个combox增强组件