怎么让一个文本框实现联想
就是在文本输入一个字 可以排列出XXX表中 name列里 所有名字首字是那个输的字的名字
哪位高手可以帮帮忙 最好 江的清楚点 用什么控件 属性要怎么改 都最好说下
当然代码 最好也写得清楚点 讲高深了听不懂 谢谢
[解决办法]
给你源码
- Delphi(Pascal) code
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Edit1: TEdit; Memo1: TMemo; Edit2: TEdit; Memo2: TMemo; Label1: TLabel; procedure FormShow(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementationuses uAutoComplete;{$R *.dfm}procedure TForm1.FormShow(Sender: TObject);begin //引用自动完成功能用以下过程 //第二个参数是TStrings类型,用户可以自行取数,只要最终转化为TStrings类型即可 SetAutoCompleteControl(Edit1, Memo1.Lines); SetAutoCompleteControl(Edit2, Memo2.Lines);end;end.