这是一个继承的TBUTTON的控件,是否是你指的类呢?
unit ListBtn;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, extctrls;
type
TListBtn = class(TButton)
private
{ Private declarations }
FOwner: TCustomEdit;
procedure FSetOwner(Sender: TCustomEdit);
protected
{ Protected declarations }
public
{ Public declarations }
constructor Create(AOwner: TComponent);
override;
procedure Click;
override;
published
{ Published declarations }
property Owner: TCustomEdit read FOwner write FSetOwner;
end;
procedure Register;
implementation
{$R LISTBTN.RES}
procedure Register;
begin
RegisterComponents('User Define', [TListBtn]);
end;
constructor TListBtn.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
Width := 21;
Height := 21;
Constraints.MaxHeight := 21;
Constraints.MaxWidth := 21;
Constraints.MinHeight := 21;
Constraints.MinWidth := 21;
Font.Name := 'SYSTEM';
Font.Size := 8;
Caption := '...';
TabStop := False;
end;
procedure TListBtn.Click;
begin
if not (Visible and Enabled) then
exit;
if FOwner <> nil then
begin
if not (FOwner.Enabled and FOwner.Visible) then
exit;
FOwner.SetFocus;
end;
inherited Click;
end;
procedure TListBtn.FSetOwner(Sender: TCustomEdit);
begin
FOwner := Sender;
if (Sender = nil) then
exit;
Left := Sender.Left + Sender.Width + 1;
Top := Sender.Top;
end;
end.