掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
クラス名を知るには? (ID:28584)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
継承元のクラスで処理を分けるには以下のようにすれば可能です if TObject(Button1) is TGraphicControl then Caption := Caption + ' GraphicControl'; if TObject(Button1) is TWinControl then Caption := Caption + ' WinControl'; if TObject(Button1) is TButtonControl then Caption := Caption + ' ButtonControl'; 例では Button は TWinControl と TButtonControl を継承していますので Caption に WinControl と ButtonControl が表示されます 関数に Sender を与えているのならば if Sender is TButtonControl then Caption := Caption + ' ButtonControl'; のような形でも可能です
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.