27044 total geeks with 3527 solutions
Recent challengers:
 Welcome, you are an anonymous user! [register] [login] Get a yourname@osix.net email address 

Articles

GEEK

User's box
Username:
Password:

Forgot password?
New account

Shoutbox
sdchristebrad
[b][url=http ://www.links oflondonbrac elet.com/]li nks of london<stron g><a href="http:/ /www.linksof londonbracel et.com/">lin ks of london outlet store</a></s trong> <br> <strong><a href="http:/ /www.linksof londonbracel et.com/">Che ap Links Of London Jewelry Whole
sdchristebrad
<ul><li><str ong><a href="http:/ /www.mobilph onewatch.com /">swiss Mechanical movement replica watches</a>< /strong> </l i><li><stron g><a href="http:/ /www.mobilph onewatch.com /">watches</ a></strong> </li><li><st rong><a href="http:/ /www.mobilph onewatch.com /">swi
MaxMouse
It's Friday... That's good enough for me!
CodeX
non stop lolz here but thats soon to end thanks to uni, surely the rest of the world is going good?
stabat
how things are going guys? Here... boring...

Donate
Donate and help us fund new challenges
Donate!
Due Date: Oct 31
October Goal: $40.00
Gross: $0.00
Net Balance: $0.00
Left to go: $40.00
Contributors


News Feeds
The Register
German data commish
makes a Hamburger
out of Google
Hong Kong
protesters targeted
with iOS, Droid
spyware
One million people
have bonked on
London public
transport
Researcher details
nasty XSS flaw in
popular web editor
The Geek Chorus
DataDirect Networks
stuffs tricky GPFS
file system into
GS2K box
Huawei promises
?1.5 BILLION French
investment
AMD, Oracle sweep
their glasses off
the table, ARM
wrestle Hadoop for
the data center
Nadella tells
India: Microsoft
data centres coming
YOUR way
US hack attack
netted Apache
chopper training
software, say feds
Slashdot
The Executive Order
That Redefines Data
Collection
Antarctic Ice Loss
Big Enough To Cause
Measurable Shift In
Earth"s Gravity
Mysterious Feature
Appears and
Disappears In a Sea
On Titan
Are the World"s
Religions Ready For
ET?
Arducorder, Next
Open Source Science
Tricorder-like
Device, Nears
Completion
Hong Kong
Protesters Use Mesh
Networks To
Organize
Joey Hudy: From
High School Kid to
Celebrity Maker to
Intel Intern
(Video)
Ebola Has Made It
To the United
States
Four Charged With
Stealing Army
Helicopter Training
Software
Grooveshark Found
Guilty of Massive
Copyright
Infringement
Article viewer

How to stop a Form from Closing in Delphi



Written by:xeno2
Published by:Nightscript
Published on:2004-06-17 13:31:36
Topic:Delphi
Search OSI about Delphi.More articles by xeno2.
 viewed 14983 times send this article printer friendly

Digg this!
    Rate this article :
Rewriting this article to use with Delphi.

This example use one simple command - ABORT;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  if MessageDlg('Do you really want to close this application?',mtWarning,[mbYes,mbNo],0)=mrNo then
    abort;
end;


Very simple ;o) - but working very well ;o)

Did you like this article? There are hundreds more.

Comments:
Anonymous
2009-07-27 09:50:26
This code is Wrong.. Not working..
Code must be..
if MessageDlg('Do you really want to close this application?',mtWarning,[mbYes,mbNo],0)=mrNo then
action := caNone;

Thanks. Fatih Murat ARSAL
Anonymous
2010-02-20 00:19:27
this code is Work very well Anonymous! No Problem with any delphi compiler.

so my official compiler is doing this with abort syntax.

javad rahmatzadeh
Anonymously add a comment: (or register here)
(registration is really fast and we send you no spam)
BB Code is enabled.
Captcha Number:



     
Your Ad Here
 
Copyright Open Source Institute, 2006