如何使用Delphi设置自定义控件的?

更新于
2026-10-05 01:18:35
0阅读来源:SEO基础
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计181个文字,预计阅读时间需要1分钟。

我有一个自定义控件,祖先是一个自定义控件,谁的祖先先于TPanel;即TNotMyCustomControl=class(TPanel);TMyCustomControl=class(TNotMyCustomControl);设置时是否可以做出响应(运行时或设计时)。

我有一个自定义控件,
祖先是另一个自定义控件,
谁的祖先是TPanel;
即

TNotMyCustomControl = class(Tpanel); TMyCustomControl = class(TNotMyCustomControl);

设置标题时是否可以做出反应(运行时间或设计时间),并且仍然将更改传递给Ancestor控件?

有可能的.只需将CMTextChanged消息处理程序添加到自定义TPanel:

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;

本文共计181个文字,预计阅读时间需要1分钟。

我有一个自定义控件,祖先是一个自定义控件,谁的祖先先于TPanel;即TNotMyCustomControl=class(TPanel);TMyCustomControl=class(TNotMyCustomControl);设置时是否可以做出响应(运行时或设计时)。

我有一个自定义控件,
祖先是另一个自定义控件,
谁的祖先是TPanel;
即

TNotMyCustomControl = class(Tpanel); TMyCustomControl = class(TNotMyCustomControl);

设置标题时是否可以做出反应(运行时间或设计时间),并且仍然将更改传递给Ancestor控件?

有可能的.只需将CMTextChanged消息处理程序添加到自定义TPanel:

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;