在属性中
在ITEMS 中加入
在STYLE 改成 csdropdownlist

解决方案 »

  1.   

    //hyh128(小黄)说的是在Delphi6中,可不支持中文function ZsComboBoxVisualInput(mComboBox: TComboBox;
      mCase: Boolean = True): Boolean; { ComboBox可视化输入 }
    var
      I, T: Integer;
    begin
      Result := False;
      if Assigned(mComboBox) then
        with mComboBox do for I := 0 to (Items.Count) do
          if (Pos(Text, Items[I]) = 1) and (Text <> Items[I]) then
          begin
            T := Length(Text);
            Text := Items[I];
            SelStart := T;
            SelLength := Length(Items[I]) - T;
            Result := True;
            Break;
          end
          else if not (mCase) and (Pos(UpperCase(Text), UpperCase(Items[I])) = 1) and
            (UpperCase(Text) <> UpperCase(Items[I])) then
          begin
            T := Length(Text);
            Text := Items[I];
            SelStart := T;
            SelLength := Length(Items[I]) - T;
            Result := True;
            Break;
          end
    end; { ZsComboBoxVisualInput }procedure TForm1.ComboBox1KeyUp(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    begin
      ZsComboBoxVisualInput(TComboBox(Sender));
    end;