Delphi中如何自定义控件并实现setCaption方法的长尾词改写?
- 内容介绍
- 文章标签
- 相关推荐
本文共计182个文字,预计阅读时间需要1分钟。
我有两个自定义控件,祖先是一个自定义控件,其名为TPanel;然后是TNotMyCustomControl;接下来定义TMyCustomControl类继承自TNotMyCustomControl;设置时,是否可以做出响应(运行时或设计时)。
我有一个自定义控件,祖先是另一个自定义控件,
谁的祖先是TPanel;
即
TNotMyCustomControl = class(Tpanel); TMyCustomControl = class(TNotMyCustomControl);
设置标题时是否可以做出反应(运行时间或设计时间),并且仍然将更改传递给Ancestor控件?
type TMyPanel = class(TPanel) private procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED; end; { ... } procedure TMyPanel.CMTextChanged(var Message: TMessage); begin inherited; ShowMessage('caption has been changed'); end;
本文共计182个文字,预计阅读时间需要1分钟。
我有两个自定义控件,祖先是一个自定义控件,其名为TPanel;然后是TNotMyCustomControl;接下来定义TMyCustomControl类继承自TNotMyCustomControl;设置时,是否可以做出响应(运行时或设计时)。
我有一个自定义控件,祖先是另一个自定义控件,
谁的祖先是TPanel;
即
TNotMyCustomControl = class(Tpanel); TMyCustomControl = class(TNotMyCustomControl);
设置标题时是否可以做出反应(运行时间或设计时间),并且仍然将更改传递给Ancestor控件?
type TMyPanel = class(TPanel) private procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED; end; { ... } procedure TMyPanel.CMTextChanged(var Message: TMessage); begin inherited; ShowMessage('caption has been changed'); end;

