掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
DelphiのRADでフォーム以外のクラスを継承できませんか? (ID:8691)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
こんな感じです。デフォルトで黄色いパネルをつくります。 unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls; // ExtCtrls を加える type TMyPanel = class(TPanel) private protected public constructor Create(AOwner: TComponent); override; end; TForm1 = class(TForm) Button1: TButton; procedure FormCreate(Sender: TObject); private { Private 宣言 } public MyPanel:TMyPanel; end; var Form1: TForm1; implementation {$R *.DFM} { TMyPanel } constructor TMyPanel.Create(AOwner: TComponent); begin inherited; Color := clYellow; end; procedure TForm1.FormCreate(Sender: TObject); begin MyPanel := TMyPanel.Create(self); MyPanel.Parent := self; MyPanel.Left := 10; MyPanel.Top := 10; MyPanel.Caption := 'This is MyPanel'; end; end.
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.