相変わらず質問ばかりですみません。
よろしくお願いします。
TMyPanel のようなものを作っています。
派生元クラスを TCustomPanelにしています。
このパネル上に TGroupBox を貼り付けます。
このコンポーネントをフォームに貼り付けたとき
コンポーネントのネームを TGroupBox の Caption に
設定し、CustomPanel の Caption は空にしたいのです。
どうすればよいのでしょうか?
コード的には以下のような感じですけど・・
<<前略>>
type
TRadioPanel = class(TCustomPanel)
private
RadioGroup: TRadioGroup;
protected
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
end;
<<中略>>
constructor TRadioPanel.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
// RadioGroup の設定
RadioGroup := TRadioGroup.Create(Self);
RadioGroup.Parent := Self;
RadioGroup.Parent := Name;
end;
destructor TRadioPanel.Destroy;
begin
RadioGroup.Free;
inherited;
end;
end.
すみません。
コードに間違いがありました
> RadioGroup := TRadioGroup.Create(Self);
> RadioGroup.Parent := Self;
> RadioGroup.Parent := Name;
↓↓↓↓↓↓↓↓↓↓↓
RadioGroup := TRadioGroup.Create(Self);
RadioGroup.Parent := Self;
RadioGroup.Caption := Name;
どちらにしても
Caption は空のままで表示されません。
ちなみに、Delphi7、WindowsXP です。
自己解決ですみません。
表示できるようになりました。
どうもすみませんでした。
ツイート | ![]() |