S
Sohe
Unregistered / Unconfirmed
GUEST, unregistred user!
我自已做了一个控件,就是一个MastEdit和Edit控件组合在一起(这两个控件放在一个Panel上),因为要传递一些参数,所以不能用Frame, 可是把这个控件拖到表单上时,只
能看到和修改Panel的属性,而MastEdit和Edit的属性都看不到。
哪位能帮我改一下,能让MastEdit和Edit的属性都能显示以便修改。
unit CodeNamePanel;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Controls, StdCtrls, Mask, ExtCtrls;
type
TpanCodeName = Class(TPanel)
private
FSQL: String;
FTitle: String;
FField: String;
FCode: TMaskEdit;
FName: TEdit;
procedure SetCode(Value: TMaskEdit);
procedure SetName(Value: TEdit);
protected
property EditCode: TMaskEdit read FCode write SetCode;
property EditName: TEdit read FName write SetName;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy;
published
//
end;
procedure Register;
implementation
constructor TPanCodeName.Create(AOwner: TComponent);
var
FCode: TMaskEdit;
FName: TEdit;
begin
inherited Create(AOwner);
FCode := TMaskEdit.Create(nil);
FCode.Parent := self;
FCode.Width := 65;
FName := TEdit.Create(nil);
FName.Parent := self;
FName.Left := 65;
Self.BevelOuter := bvNone;
Self.Caption := '';
Self.Height := Self.Controls[0].Height + 2;
Self.width := Self.Controls[0].Width + Self.Controls[1].Width;
end;
destructor TPanCodeName.Destroy;
begin
FName.Free;
FCode.Free;
inherited Destroy;
end;
procedure TPanCodeName.SetCode(Value: TMaskEdit);
begin
EditCode.Assign(Value);
end;
procedure TPanCodeName.SetName(Value: TEdit);
begin
EditName.Assign(Value);
end;
procedure Register;
begin
RegisterComponents('XhLib', [TPanCodeName]);
end;
end.
能看到和修改Panel的属性,而MastEdit和Edit的属性都看不到。
哪位能帮我改一下,能让MastEdit和Edit的属性都能显示以便修改。
unit CodeNamePanel;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Controls, StdCtrls, Mask, ExtCtrls;
type
TpanCodeName = Class(TPanel)
private
FSQL: String;
FTitle: String;
FField: String;
FCode: TMaskEdit;
FName: TEdit;
procedure SetCode(Value: TMaskEdit);
procedure SetName(Value: TEdit);
protected
property EditCode: TMaskEdit read FCode write SetCode;
property EditName: TEdit read FName write SetName;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy;
published
//
end;
procedure Register;
implementation
constructor TPanCodeName.Create(AOwner: TComponent);
var
FCode: TMaskEdit;
FName: TEdit;
begin
inherited Create(AOwner);
FCode := TMaskEdit.Create(nil);
FCode.Parent := self;
FCode.Width := 65;
FName := TEdit.Create(nil);
FName.Parent := self;
FName.Left := 65;
Self.BevelOuter := bvNone;
Self.Caption := '';
Self.Height := Self.Controls[0].Height + 2;
Self.width := Self.Controls[0].Width + Self.Controls[1].Width;
end;
destructor TPanCodeName.Destroy;
begin
FName.Free;
FCode.Free;
inherited Destroy;
end;
procedure TPanCodeName.SetCode(Value: TMaskEdit);
begin
EditCode.Assign(Value);
end;
procedure TPanCodeName.SetName(Value: TEdit);
begin
EditName.Assign(Value);
end;
procedure Register;
begin
RegisterComponents('XhLib', [TPanCodeName]);
end;
end.