请教 TMenuItem 继承类问题 ( 积分: 50 )

  • 主题发起人 主题发起人 oupj
  • 开始时间 开始时间
O

oupj

Unregistered / Unconfirmed
GUEST, unregistred user!
TMnuItem = class(TMenuItem)
private
FCaption: TCaption;
FVisible: Boolean;
function GetCaption: TCaption;
procedure SetCaption(const Value: Boolean);
function GetVisible: Boolean;
procedure SetVisible(const Value: Boolean);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
property Caption: string read FCodeHead write FCodeHead;
property Visible: Integer read FCodeLen write FCodeLen;
end;

怎样做到改变Caption 或 Visible 时随即更改继承TMnuItem的控件Caption 和 Visible 值
 
TMnuItem = class(TMenuItem)
private
FCaption: TCaption;
FVisible: Boolean;
function GetCaption: TCaption;
procedure SetCaption(const Value: Boolean);
function GetVisible: Boolean;
procedure SetVisible(const Value: Boolean);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
property Caption: string read FCodeHead write FCodeHead;
property Visible: Integer read FCodeLen write FCodeLen;
end;

怎样做到改变Caption 或 Visible 时随即更改继承TMnuItem的控件Caption 和 Visible 值
 
property Caption: string read FCaption write SetCaption;

procedure TMnuItem.SetCaption(const Value: string);
begin
inherited Caption := Value;
end;

Visible类似。
 

Similar threads

I
回复
0
查看
641
import
I
I
回复
0
查看
743
import
I
I
回复
0
查看
491
import
I
I
回复
0
查看
553
import
I
后退
顶部