笨蛋,你把它放在主窗体的create事件里就可以了

解决方案 »

  1.   

    把代码放在工程文件中,算了,我给你一个例子。看好了:
    program Initialize;uses
      Forms,
      Dialogs,
      Controls,
      MainFrm in 'MainFrm.pas' {MainForm};{$R *.RES}var
      Password: String;
    begin
      if InputQuery('Password', 'Enter your password', PassWord) then
        if Password = 'D5DG' then
        begin
          // Other initialization routines can go here.
          Application.CreateForm(TMainForm, MainForm);
        Application.Run;
        end
        else
          MessageDlg('Incorrect Password, terminating program', mtError, [mbok], 0);
    end.
      

  2.   

    要是我做也是用楼上的方法!!
    放在Create或OnShow我感觉是不大好!!!
    这个东西与做启动封面(Splash--闪屏)是一个原理!