Solved

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

Posted on 2006-07-15
1
244 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
fdehell earned 125 total points
ID: 17113935
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi XE10 Round Image 2 225
How to build JSON File in Delphi 6 3 94
Tvertscrollbox like a whatsapp layout delete messages 1 50
delphi popmenu non latine charcters 3 48
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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

734 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