Aplikasi Perpustakaan - Edisi 9 (Form Startup)

Program Perpustakaan.


Tampilan Menu Utama
1. Membuat Form Startup.

Agar tampilan aplikasi lebih menarik lagi dan tidak membuat bosan, berikut saya tambahkan form startup agar terlihat cantik, untuk source kode bisa copas juga gan:

source code:
1: unit Unit1;
2:
3: interface
4:
5: uses
6: Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
7: Dialogs, XPMan, ExtCtrls, StdCtrls, ComCtrls, acPNG, jpeg;
8:
9: type
10: TForm_Startup = class(TForm)
11: XPManifest1: TXPManifest;
12: ProgressBar1: TProgressBar;
13: Timer1: TTimer;
14: Image1: TImage;
15: Label1: TLabel;
16: procedure FormActivate(Sender: TObject);
17: procedure Timer1Timer(Sender: TObject);
18: private
19: { Private declarations }
20: public
21: { Public declarations }
22: end;
23:
24: var
25: Form_Startup: TForm_Startup;
26: mundur: integer;
27: bGantiImg: boolean;
28:
29: implementation
30:
31: uses unit2;
32:
33: {$R *.dfm}
34:
35: procedure TForm_Startup.FormActivate(Sender: TObject);
36: begin
37: image1.Picture.LoadFromFile(ExtractFilePath(Application.ExeName) +
'\Img\face-smile.png');
38: mundur := 6;
39: bGantiImg := false;
40: end;
41:
42: procedure TForm_Startup.Timer1Timer(Sender: TObject);
43: begin
44: if progressbar1.Position < 100 then
45: begin
46: progressbar1.Position := progressbar1.Position + 20;
47: end
48: else
49: begin
50: if bGantiImg = false then
51: begin
52: image1.Picture.LoadFromFile(ExtractFilePath(Application.ExeName) +
'\Img\face-smile-big.png');
53: bGantiImg := true;
54: end;
55: mundur := mundur - 1;
56: if mundur = 0 then
57: begin;
58: timer1.Enabled := false;
59: self.Hide;
60: Form_Utama.Width := Screen.Width;
61: Form_Utama.Height := Screen.Height;
62: Form_Utama.Show;
63: end;
64: end;
65: end;
66:
67: end.

Comments