⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 maintest.pas

📁 delphi 里做一个智能combo box 的程序。
💻 PAS
字号:
unit MainTest;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, IncCombobox;

type
  TForm1 = class(TForm)
    IncCombobox1: TIncCombobox;
    IncCombobox2: TIncCombobox;
    Label1: TLabel;
    procedure IncCombobox1KeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.IncCombobox1KeyPress(Sender: TObject; var Key: Char);
begin
// if the user keys <Enter> add the text to the combobox
  if Key = #13 then begin
    with (Sender as TIncCombobox) do begin
      AddOrMoveItem(Text);
      SelectAll;
    end;
    Key := #0;
  end;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -