나는 한 가지 방법은 다음과 같은 목적으로 제공하는 "무대 뒤의"기본 폼이하는 것이라고 생각했을 것이다
:
선택과 같은 다른 형태 중 하나를 표시하려면를 메인 폼을 만든 다음 끊임없이 숨기기 (Visible : = FALSE) 좋은 구식 "플래시"스크린처럼.
기본 양식으로 선택한 양식을 닫을 때 응용 프로그램 종료 자 역할을 수행합니다 (적절한 OnClose 이벤트 연결).
숨겨진 실제 주 양식이 "의사 주 양식"이 아닌 다른 양식의 "소유자"가되도록 지정된 의사 주 양식을 대신하여 다른 양식을여십시오. 모든 다른 양식에 '비'팝업 스타일이 있고 ShowModal이 아닌 Show (쇼) 호출을 통해 표시되는 경우이 작업이 수행됩니다.
이렇게 응용 프로그램의 동작을 약간 재구성하면 원하는 종류의 사용자 상호 작용을 얻을 수 있습니다.
unit FlashForm;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.StdCtrls;
type
TFlash = class(TForm)
lblTitle: TLabel;
lblCopyright: TLabel;
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
public
procedure CloseApp;
end;
var
Flash: TFlash;
implementation
{$R *.dfm}
uses Main;
procedure TFlash.CloseApp; // Call this from the Main.Form1.OnClose or CanClose (OnFormCloseQuery) event handlers
begin
close
end;
procedure TFlash.FormCreate(Sender: TObject); // You can get rid of the standard border icons if you want to
begin
lblCopyright.Caption := 'Copyright (c) 2016 AT Software Engineering Ltd';
Refresh;
Show;
BringToFront;
end;
procedure TFlash.Timer1Timer(Sender: TObject);
begin
Application.MainFormOnTaskBar := FALSE; // This keeps the taskbar icon alive
if assigned(Main.MainForm) then
begin
visible := FALSE;
Main.MainForm.Show;
Timer1.Enabled := FALSE;
end else Timer1.Interval := 10; // The initial time is longer than this (flash showing time)
end;
end.
// Finally, make this the FIRST form created by the application in the project file.
언급 문서 지금 [여기 (http://www.stevetrefethen.com/blog/the-new-vcl-property-tapplication-mainformontaskbar-in-delphi-2007). –