[DUG] Edit box exit event
Rohit Gupta
rohit at cfl.co.nz
Wed Jan 25 11:06:58 NZDT 2006
There are no elegant solutions. However what helps us is that we
normally use speedbuttons so there is no focus change or the
related exit event.
From: "John Bird" <johnkbird at paradise.net.nz>
To: "'NZ Borland Developers Group - Delphi List'" <delphi at ns3.123.co.nz>
Subject: [DUG] Edit box exit event
Date sent: Wed, 25 Jan 2006 09:45:32 +1300
Organization: John Bird Consulting
Send reply to: johnkbird at paradise.net.nz,
NZ Borland Developers Group - Delphi List <delphi at ns3.123.co.nz>
<mailto:delphi-request at ns3.123.co.nz?subject=unsubscribe>
<mailto:delphi-request at ns3.123.co.nz?subject=subscribe>
[ Double-click this line for list subscription options ]
On an edit box (TEdit), in the exit event I often will have some
verification code for any alteration made to the text.
However sometimes I don't want it to fire, for example if elsewhere on the
form is an unrelated button eg "Setup Options" and the user clicks there in
this case I just want focus to go to the other control, without firing the
exit event. (I don't mind losing the contents or the checking of the Tedit
in this case, as the user has elected to do something unrelated). However
the exit event on the Tedit fires before any event code on the Tbutton
(Setup Options) fires.
It seems to me to require code in the Tedit exit event checking how the exit
has been fired...whether by Tab key, or by clicking elsewhere. But this
gets quite tedious if there is a screen of Tedits. And it has to be smart -
if the user has just clicked on the next Tedit field, in that case I would
want the exit event on the previous one to still fire.
How do others do this - is there an elegant way?
John
_______________________________________________
Delphi mailing list
Delphi at ns3.123.co.nz
http://ns3.123.co.nz/mailman/listinfo/delphi
Regards
Rohit
======================================================================
CFL - Computer Fanatics Ltd. 21 Barry's Point Road, AKL, New Zealand
PH (649) 489-2280
FX (649) 489-2290
email rohit at cfl.co.nz or r.gupta at xtra.co.nz
======================================================================
More information about the Delphi
mailing list