diff --git a/about1.lfm b/about1.lfm index 1e983b7..6746bdb 100644 --- a/about1.lfm +++ b/about1.lfm @@ -10,6 +10,7 @@ object AboutBox: TAboutBox Font.Color = clWindowText Font.Height = -14 Font.Name = 'Tahoma' + OnCreate = FormCreate Position = poScreenCenter LCLVersion = '2.0.6.0' object Panel1: TPanel diff --git a/about1.pas b/about1.pas index dfaf755..31b7816 100644 --- a/about1.pas +++ b/about1.pas @@ -5,9 +5,12 @@ unit about1; interface uses SysUtils, Classes, Graphics, Forms, Controls, StdCtrls, - Buttons, ExtCtrls; + Buttons, ExtCtrls, fileinfo; type + + { TAboutBox } + TAboutBox = class(TForm) Panel1: TPanel; ProductName: TLabel; @@ -15,6 +18,7 @@ type Copyright: TLabel; Comments: TLabel; OKButton: TButton; + procedure FormCreate(Sender: TObject); private { Private declarations } public @@ -28,5 +32,20 @@ implementation {$R *.lfm} +{ TAboutBox } + +procedure TAboutBox.FormCreate(Sender: TObject); +var + FileVerInfo: TFileVersionInfo; +begin + FileVerInfo := TFileVersionInfo.Create(nil); + try + FileVerInfo.ReadFileInfo; + Version.Caption := 'Version ' + FileVerInfo.VersionStrings.Values['FileVersion']; + finally + FileVerInfo.Free; + end; +end; + end.