Hi Carl,
On Monday, 2 June 1997 at 11:54:37, Carl Waring confused me
talking about: Delphi 1.0 to All
CW> Well Howdy Doody All!
Hello!!
CW> Having learned a little about VB, I was delighted to
CW> find Delphi 1.0 doing the Cover CD rounds recently. I have
Defect! Use Delphi all the time ;)
CW> the little book that came with PC Plus and have printed out
CW> the PDF files. However, I have been trying to produce an
CW> 'About' box with the '.ShowModal' device but cannot get it
CW> to work. A detailed example would be appreciated if someone
CW> has the time.
From something I'm doing at the moment....
In the unit from which you want the about box to pop up (i.e. your main
orm),
make sure that you tell Delphi which file, the about box is in.
If you don't know what it is called, click on the aboutbox form and then
click on Delphi's form to unit button so that the code pops up. The filename
is in the window titlebar. You drop the ".PAS" extension.
Mine is called about.pas, so under implementation you put "uses about;"
[...]
implementation
uses about;
[...]
Then you need to show the form. I've created a menu item to do this (help,
about) but it could be a button or anything.
In either case, when you double click on your button or menu item, the
code window should pop up ready for you to insert your code to show the
about box.
The name of my aboutbox (the standard Delphi 1 one) is aboutbox hence:
procedure Tdiaryfrm.About1Click(Sender: TObject);
begin
aboutbox.showmodal;
end;
The bit you'll need to type is the "aboutbox.showmodal;" bit.
That should work with the defaults (I just tried it).
Not trusting Borland however I put the following in the code for when the
OK button was clicked to ensure it closed. (I don't think it is
strictly necessary.)
procedure TAboutBox.okbutClick(Sender: TObject);
begin
aboutbox.close;
end;
And that should be it.
If your about box isn't called about box then just change those parts and it
should still work.
If you want any more help I'll be glad to help and there are other more
experienced users of Delphi in here too.
I hope you enjoy Delphi ;)
bfn,
si.
Fido: 2:440/7.15 *** SEE IT. LIVE IT. BE IT. TREK_RANKS_UK ***
Internet: huggie@dial.pipex.com
Web: http://ds.dial.pipex.com/huggie
.!. What was the greatest thing before sliced bread?
--- Terminate 4.00/Pro
---------------
* Origin: Fou, con et anglais! (2:440/7.15)
|