掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
ポップアップメニューの表示有無を取得するには? (ID:23583)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
鳴かせて見せようホトトギス♪ (秀吉) ※PopupMenuコンポに OnDestroyイベント追加 type TPopupMenuEx = class(TPopupMenu) private FOnDestroy: TNotifyEvent; published property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; end; constructor TPopupMenuEx.Create(AOwner: TComponent); begin Inherited Create(AOwner); AutoPopup := False; FOnDestroy := nil; end; destructor TPopupMenuEx.Destroy; begin Inherited Destroy; if Assigned(FOnDestroy) then FOnDestroy(Self); end; // OnDestroyイベントはんどら procedure TForm1.PopupMenuExDestroy(Sender: TObject); begin // マークを消す end; procedure TForm1.ほにゃ(...; X,Y: Integer); begin ... with TPopupMenuEx.Create(Self) do try OnPopup := PopupMenuExPopup; OnDestroy := PopupMenuExDestroy; ... //メニュー項目作成、追加 with ClientToScreen(Point(X,Y)) do Popup(X, Y); finally Free; end; ... end;
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.