W
wang2855
Unregistered / Unconfirmed
GUEST, unregistred user!
[]
Hello:
我想做一个控件就是在DBLookupCombobox的基础上,当单击下拉箭头时能够弹出一个
DBGrid来显示下啦数据表的内容,可是为什么不行呢?
在继承控件的DropDown事件中:
procedure TMyDBLookupCombobox.Dropdown;
var FLookupGrid:TDBGrid
begin
inherited;
if Assigned(ListSource) then
begin
FLookupGrid:=TDBGrid.Create(self);
FLookupgrid.Parent:=Self;
FLookupGrid.DataSource:=ListSource;
FLookupGrid.Left:=Left;
FLookupGrid.Width:=Width;
FLookupGrid.Top:=Top+Height;
FLookupGrid.Height:=1000;
FLookupGrid.Visible:=True;
Invalidate;
end;
end;
Hello:
我想做一个控件就是在DBLookupCombobox的基础上,当单击下拉箭头时能够弹出一个
DBGrid来显示下啦数据表的内容,可是为什么不行呢?
在继承控件的DropDown事件中:
procedure TMyDBLookupCombobox.Dropdown;
var FLookupGrid:TDBGrid
begin
inherited;
if Assigned(ListSource) then
begin
FLookupGrid:=TDBGrid.Create(self);
FLookupgrid.Parent:=Self;
FLookupGrid.DataSource:=ListSource;
FLookupGrid.Left:=Left;
FLookupGrid.Width:=Width;
FLookupGrid.Top:=Top+Height;
FLookupGrid.Height:=1000;
FLookupGrid.Visible:=True;
Invalidate;
end;
end;