Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2008.05.11;
Скачать: CL | DM;

Вниз

Титульный лист в программе   Найти похожие ветки 

 
Миша   (2008-04-15 10:42) [0]

Подскажите, как лучше сделать титульную форму в программе. Как в MS Word например.
То есть просто должна запуститься форма и через 30 секунд она закрывается и открывается главная форма. Если использовать Таймер на титульной форме, то она все время отрабатывает по разному. То есть иногда через 20 секунд закрывается и открывает главную, иногда вообще через 10 секунд. Подскажите, как поступить.


 
Игорь Шевченко ©   (2008-04-15 11:13) [1]

Program Files\Borland\Delphi\Demos\MastApp\*.*


 
{RASkov} ©   (2008-04-15 11:23) [2]

Сплэш(Splash) окно(форма)...
Можно привязывать к таймеру, а можно к выполняемому коду... т.е. пока идет какой-то процесс сплэшформа видна, затем закрывается...


 
{RASkov} ©   (2008-04-15 12:17) [3]

Вот можно примерно так - пример показа сплэша пока идет процесс:
program Project1;
uses Forms,
    Unit1 in "Unit1.pas" {Form1},
    Unit2 in "Unit2.pas" {Form2};
{$R *.res}
begin
 Application.Initialize;
 SplashFrm:=TForm2.Create(nil);
 with SplashFrm do try
  InitializeSplash;
  Application.CreateForm(TForm1, Form1);
 finally
  Free;
 end;
 Application.Run;
end.
//--------------------------------------------------------------

Главная форма:
unit Unit1;
interface
uses
 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
 Dialogs;

type
 TForm1 = class(TForm)
   procedure FormCreate(Sender: TObject);
 private
   { Private declarations }
 public
   { Public declarations }
 end;

var Form1: TForm1;

implementation
uses Unit2;
{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
const Str: array [0..4] of String = ("Pictures", "Sounds", "Cursors", "Icons", "Data");
var N: Integer;
begin
 for N:=0 to 4 do begin
  SplashFrm.UpdateStatus(N*10, Format("Loading: ...%s", [Str[N]]));
  Sleep(1000);
 end;
end;

end.
//---------------------------------------------------------------------------

Сплэш форма
unit Unit2;
interface
uses
 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
 Dialogs, ExtCtrls, StdCtrls, ComCtrls;

type
 TForm2 = class(TForm)
   ProgressBar1: TProgressBar;
   Label1: TLabel;
   Image1: TImage;
 private
   { Private declarations }
 public
   procedure InitializeSplash;
   procedure UpdateStatus(const Pr: Integer; const Txt: String);
   { Public declarations }
 end;

var SplashFrm: TForm2;

implementation

{$R *.dfm}

procedure TForm2.InitializeSplash;
begin
 ProgressBar1.Position:=0;
 ProgressBar1.Max:=40;
 Show;
end;

procedure TForm2.UpdateStatus(const Pr: Integer; const Txt: String);
begin
 Label1.Caption:=Txt;
 ProgressBar1.Position:=Pr;
 Application.ProcessMessages;
end;

end.

По таймеру немного по другому...


 
Миша   (2008-04-15 12:21) [4]

2 {RASkov}

Пасиб. сейчас буду пробовать.



Страницы: 1 вся ветка

Текущий архив: 2008.05.11;
Скачать: CL | DM;

Наверх




Память: 0.46 MB
Время: 0.006 c
2-1207725582
Footballer
2008-04-09 11:19
2008.05.11
UDP


2-1208248370
DFT
2008-04-15 12:32
2008.05.11
const


2-1208267267
assassin8899
2008-04-15 17:47
2008.05.11
AdoQuery и AdoTable


15-1206946550
Виталий____
2008-03-31 10:55
2008.05.11
Не работает отладка


2-1207841263
smartleds
2008-04-10 19:27
2008.05.11
Подскажите в чем может быть причина создаю массив меток таким





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский