掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
ウインドウを隠したり表示させたりする方法は? (ID:5232)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
単純なサンプルですが、こんな感じでどうでしょう? type TForm1 = class(TForm) Timer1: TTimer; procedure Timer1Timer(Sender: TObject); private { Private 宣言 } ARect : TRect; public { Public 宣言 } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Timer1Timer(Sender: TObject); var P : TPoint; begin if Self.Visible then begin ARect.Top := Top; ARect.Left := Left; ARect.Bottom := Top + Height; ARect.Right := Left + Width; end; GetCursorPos(P); if (P.X >= ARect.Left) and (P.X <= ARect.Right) and (P.Y >= ARect.Top ) and (P.Y <= ARect.Bottom) then begin Visible := False; end else begin Visible := True; end; end; Timer1のIntervalは、適当に設定してくださいね。 ただ、このプログラム、フォームの×で終了できません。(笑)
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.