<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.2900.2627" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=476092305-22042005><FONT face=Arial color=#0000ff size=2>Yes I
can pass on an excellent trick someone here gave me, and is useful in any
component you choose it to apply to - just put this code or a tweaked version in
the form unit:</FONT></SPAN></DIV>
<DIV><SPAN class=476092305-22042005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=476092305-22042005><FONT face=Arial color=#0000ff size=2>Make
sure you declare the procedure in the form with the extra
syntax:</FONT></SPAN></DIV>
<DIV><SPAN class=476092305-22042005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=476092305-22042005><FONT face=Arial color=#0000ff
size=2> procedure CMDialogKey(Var Msg: TWMKEY); message
CM_DIALOGKEY;</FONT></SPAN></DIV>
<DIV><SPAN class=476092305-22042005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=476092305-22042005><FONT face=Arial color=#0000ff size=2>Apart
from that it doesn't need any more coding - it intercepts the messages behind
the scenes and alters the key. Works a charm</FONT></SPAN></DIV>
<DIV><SPAN class=476092305-22042005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=476092305-22042005><FONT face=Arial color=#0000ff size=2>my
version<BR>----------<BR>procedure TfrmCoinqSrch.CMDialogKey(var Msg:
TWMKEY);<BR>{<BR> This converts ENTER key messages to TAB key
messages, provided a few<BR> conditions hold - this adds ability
also to abort/exit with escape key - Keydir is a global variable I test
in various events<BR>}<BR>begin<BR> if
(ActiveControl is TCustomEdit)<BR>// or (ActiveControl
is TDBCode)<BR>// or (ActiveControl is
TPageControl)<BR>// or (ActiveControl is
TDBLookupComboBox)<BR> or (ActiveControl is
TRadioButton)<BR> or (ActiveControl is
TStringGrid)<BR> then<BR>
begin<BR> if Msg.CharCode = VK_RETURN
then<BR>
begin<BR> Msg.CharCode :=
VK_TAB;<BR>
KeyDir:='Next';<BR>
end;<BR> if Msg.Charcode = VK_ESCAPE
then<BR>
begin<BR> Msg.CharCode :=
VK_TAB;<BR>
KeyDir:='Prev';<BR>
end;<BR> end;<BR>
inherited;<BR>end;</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=476092305-22042005><FONT face=Arial color=#0000ff
size=2>original<BR>To Convert Enter to Tab I use the following
code:</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=476092305-22042005><FONT face=Arial color=#0000ff
size=2>Attached to the form:<BR> procedure
CMDialogKey(Var Msg: TWMKEY); message CM_DIALOGKEY;</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=476092305-22042005><FONT face=Arial color=#0000ff
size=2><BR>procedure TMyForm.CMDialogKey(var Msg: TWMKEY);<BR>{<BR>
This converts ENTER key messages to TAB key messages, provided a
few<BR> conditions hold<BR>}<BR>begin<BR> if
(ActiveControl is TCustomEdit)<BR> or (ActiveControl is
TDBCode)<BR> or (ActiveControl is
TPageControl)<BR> or (ActiveControl is
TDBLookupComboBox)<BR> or (ActiveControl is
TDBComboBox)<BR> then<BR> if Msg.CharCode =
VK_RETURN then<BR> Msg.CharCode :=
VK_TAB;<BR> inherited;<BR>end;<BR></FONT></SPAN></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV class=Section1>
<P class=MsoAutoSig align=left>John Bird</P>
<P class=MsoAutoSig><FONT face=Arial size=2>email </FONT><A
href="mailto:johnkbird@paradise.net.nz">johnkbird@paradise.net.nz</A></P>
<P class=MsoAutoSig><FONT face=Arial size=2>Consultant for Beyond Data
Systems/Acclipse Legal</FONT></P>
<P class=MsoAutoSig>Ph land (03)384-4527 mobile (027)484-4528</P>
<P class=MsoAutoSig>92 Soleares Ave, Mt Pleasant</P>
<P class=MsoAutoSig>Christchurch</P>
<P class=MsoAutoSig><?xml:namespace prefix = o ns =
"urn:schemas-microsoft-com:office:office" /><o:p><FONT face=Arial size=2>Web <A
href="http://www.123.co.nz/johnbird">www.123.co.nz/johnbird</A></FONT></o:p></P>
<P class=MsoAutoSig><o:p><FONT face=Arial size=2></FONT></o:p> </P>
<P class=MsoAutoSig><o:p><!--StartFragment --> </o:p></P></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B>
delphi-bounces@ns3.123.co.nz [mailto:delphi-bounces@ns3.123.co.nz] <B>On
Behalf Of </B>Robert Wilson<BR><B>Sent:</B> Friday, 22 April 2005 3:43
p.m.<BR><B>To:</B> delphi@ns3.123.co.nz<BR><B>Subject:</B> [DUG] Re:
DBGrid<BR><BR></FONT></DIV><BR><FONT face=sans-serif size=2><BR>Hi</FONT>
<BR><FONT face=sans-serif size=2>Friday afternoon and Help!!</FONT> <BR><FONT
face=sans-serif size=2>Trying to get enter key to behave like tab in a dbgrid.
I'm sure it is something really simple that I i'm missing!</FONT> <BR><FONT
face=sans-serif size=2>Help would be appreciated.</FONT> <BR><BR><FONT
face=sans-serif size=2>Cheers</FONT> <BR><FONT face=sans-serif
size=2>Robert</FONT> <BR><BR><FONT face=sans-serif size=2>Cellular Cellnet Ltd
NZ.</FONT>
<HR>
<STRONG><FONT color=#ff0000>Attention: </FONT></STRONG><BR>Disclaimer:
<P>The information in this electronic mail message is confidential and may be
legally privileged. It is intended solely for the addressee. Access to this
Internet electronic mail message by anyone else is unauthorised. </P>
<P>If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on it is
prohibited and may be unlawful. <BR>If you have received this e-mail by
mistake please call the sender immediately on 09 415 4747 and erase the
original message and any attachments.</P>
<P>Cellular Cellnet (NZ) Ltd accepts no responsibility for any effects this
email message or attachments has on the recipient network or computer system.
<HR>
<P></P></BLOCKQUOTE></BODY></HTML>