unit ComboListBox;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls,ExtCtrls;type
TComboListBox = class(TComboBox)
private
{ Private declarations }
AutoListbox:TListbox;
mouseclick:boolean;
procedure listboxclick(sender:TObject);
protected
{ Protected declarations }
procedure Change;override;
public
{ Public declarations } published
{ Published declarations }
//property left stored true;
end;procedure Register;implementationprocedure Register;
begin
RegisterComponents('Standard', [TComboListBox]);
end;procedure TCombolistbox.listboxclick(sender:TObject);
begin
text:=AutoListbox.items[AutoListbox.itemIndex];
autolistbox.free;
mouseclick:=true;
end;procedure TCombolistbox.Change;
var
i:integer;
begin
inherited;
if not mouseclick then
begin
if not assigned(Autolistbox) then
begin
AutoListbox:=TListbox.create(self);
AutoListbox.parent:=TWincontrol(self.Owner);
Autolistbox.top:=top+height;
Autolistbox.left:=left;
AutoListbox.width:=Width;
Autolistbox.height:=60;
Autolistbox.OnClick:=listboxClick;
mouseclick:=false;
end;
Autolistbox.items.clear;
for i:=0 to self.items.count-1 do
begin
if pos(self.text,self.items[i])>0 then
Autolistbox.Items.add(self.items[i]);
//Autolistbox.Refresh;
end;
Autolistbox.sorted:=true;
end;
end;end.
望高手们指点,谢谢。
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls,ExtCtrls;type
TComboListBox = class(TComboBox)
private
{ Private declarations }
AutoListbox:TListbox;
mouseclick:boolean;
procedure listboxclick(sender:TObject);
protected
{ Protected declarations }
procedure Change;override;
public
{ Public declarations } published
{ Published declarations }
//property left stored true;
end;procedure Register;implementationprocedure Register;
begin
RegisterComponents('Standard', [TComboListBox]);
end;procedure TCombolistbox.listboxclick(sender:TObject);
begin
text:=AutoListbox.items[AutoListbox.itemIndex];
autolistbox.free;
mouseclick:=true;
end;procedure TCombolistbox.Change;
var
i:integer;
begin
inherited;
if not mouseclick then
begin
if not assigned(Autolistbox) then
begin
AutoListbox:=TListbox.create(self);
AutoListbox.parent:=TWincontrol(self.Owner);
Autolistbox.top:=top+height;
Autolistbox.left:=left;
AutoListbox.width:=Width;
Autolistbox.height:=60;
Autolistbox.OnClick:=listboxClick;
mouseclick:=false;
end;
Autolistbox.items.clear;
for i:=0 to self.items.count-1 do
begin
if pos(self.text,self.items[i])>0 then
Autolistbox.Items.add(self.items[i]);
//Autolistbox.Refresh;
end;
Autolistbox.sorted:=true;
end;
end;end.
望高手们指点,谢谢。
解决方案 »
- !!!!!!100分求奇思妙想编程序这本书电子版?=====
- 我開發了一個程式,客戶端的版本是,1.0.0.0,報務器的版本是:1.0.0.1,在程式裡我怎樣進行版本比較?
- 字符时间转换
- 编程高手进来看一看!!!
- Delphi6里面的TServerSocket再Delphi7里面怎么没有了?
- 能否编这样一个程序,开机后,一定要输入正确密码,硬盘才能引导进入操作系统?
- 那儿有《以Delphi学习com+》电子书下载?
- 向高手请教:我如何通过编程得到FICQ在线的某个人的IP.如输入FICQ号,显示出此人的ip.烦请高手给个思路。
- 这样合理吗?(再线等候!!!)
- 不知何时才能有真正的DELPHI中文版和中文帮助呢?
- 还是不行!客户端发送数组数据到服务端!
- 初学者的几个问题,很多,分不够再加
里面有候选项,当选择一个字符串时报错。
你有没有试过这个控件?