Solved

How to let my ini file determine whether to show a splash screen?

Posted on 2006-07-15
1
228 Views
Last Modified: 2010-04-05
Hi Wizards!

I want the user to be able to control whether a splashscreen is shown or not. THis shoudl be done by means of a checkbox in the application in conjunction with an inifile. Now this is what I have >

//code

private
    FShowSplash: Boolean;
    property ShowSplash: Boolean read FShowSplash write FShowSplash;
......

procedure TForm1.FormCreate(Sender: TObject);
var
  Ini: TIniFile;
begin
  Ini := TIniFile.Create( ChangeFileExt( Application.ExeName, '.INI' ) );
  try if
  Ini.ReadBool('GUI','ShowSplash', False) then
  ShowSplash := False else
  ShowSplash := True;
  finally
    TIniFile.Free;
end;
end;

.....

procedure TForm1.FormShow(Sender: TObject);
begin
if ShowSplash then
    Sleep(1000);
  fSplash.Release;
end;

// end of code

Delphi's complaint:[Error] Main.pas(61): This form of method call only allowed for class methods. Now my guess would be that I'm doing something terribly wrong so my question is what am I doing wrong here?

Any other approaches are welcome as well ofcourse, as long as teh user is able to control whether the splash screen pops up or not.

Regards Paul :)

Ps thanks in advance and please comment as much as possible.
0
Comment
Question by:PeterdeB
1 Comment
 
LVL 1

Accepted Solution

by:
fdehell earned 125 total points
Comment Utility
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now