#1 Roulette Forum & Message Board | www.RouletteForum.cc

Roulette-focused => General Discussion => Topic started by: ThomasGrant on Oct 17, 08:44 AM 2010

Title: How to use Dialogs in RSS Pro.
Post by: ThomasGrant on Oct 17, 08:44 AM 2010
OpenDialog
link:://:.delphibasics.co.uk/RTL.asp?Name=TOpenDialog (link:://:.delphibasics.co.uk/RTL.asp?Name=TOpenDialog)

How to use OpenDialog in RSS Pro.

OpenDialog1.Title:='Open Files'; {The Titles of the Dialog Window}

OpenDialog1.InitialDir:='c:\rss-data';
{ InitialDir: The folder you wish the Dialog window to open in}

OpenDialog1.Execute(false); {This Opens the Dialog window}

if OpenDialog1.FileName='' then {If you press cancel, this message will appear}
begin
   ShowMessage('Open file was cancelled');
end;
else if OpenDialog1.FileName<>'' then {If a filenam is selected then show this message}
        ShowMessage('Open file '+OpenDialog1.FileName);
end;
Title: Re: How to use Dialogs in RSS Pro.
Post by: ophis on Oct 18, 06:27 PM 2010
Quote from: ThomasGrant link=topic=1864. msg16382#msg16382 date=1287319483
OpenDialog
hxxp: :. delphibasics. co. uk/RTL. asp?Name=TOpenDialog

How to use OpenDialog in RSS Pro.

OpenDialog1. Title:='Open Files'; {The Titles of the Dialog Window}

OpenDialog1. InitialDir:='c:\rss-data';
{ InitialDir: The folder you wish the Dialog window to open in}

OpenDialog1. Execute(false); {This Opens the Dialog window}

if OpenDialog1. FileName='' then {If you press cancel, this message will appear}
begin
   ShowMessage('Open file was cancelled');
end; <-- no ";" before "else"
else if OpenDialog1. FileName<>'' then {If a filenam is selected then show this message}
        ShowMessage('Open file '+OpenDialog1. FileName);
end;

short version:

with OpenDialog1 do begin
  Title:='Open Files';
  InitialDir:='c:\rss-data';
  Execute;

  if FileName='' then ShowMessage('Open file was cancelled')
  else ShowMessage('Open file '+OpenDialog1. FileName);
end;