<!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>&nbsp;</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>&nbsp;</DIV>
<DIV><SPAN class=476092305-22042005><FONT face=Arial color=#0000ff 
size=2>&nbsp;&nbsp;&nbsp;&nbsp; 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>&nbsp;</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.&nbsp; Works a charm</FONT></SPAN></DIV>
<DIV><SPAN class=476092305-22042005><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</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>&nbsp;&nbsp; This converts ENTER key messages to TAB key 
messages, provided a few<BR>&nbsp;&nbsp; conditions hold - this adds ability 
also to abort/exit with escape key - Keydir is a global variable I test 
in&nbsp;various events<BR>}<BR>begin<BR>&nbsp;&nbsp; if&nbsp;&nbsp; 
(ActiveControl is TCustomEdit)<BR>//&nbsp;&nbsp;&nbsp;&nbsp; or (ActiveControl 
is TDBCode)<BR>//&nbsp;&nbsp;&nbsp;&nbsp; or (ActiveControl is 
TPageControl)<BR>//&nbsp;&nbsp;&nbsp;&nbsp; or (ActiveControl is 
TDBLookupComboBox)<BR>&nbsp;&nbsp;&nbsp;&nbsp; or (ActiveControl is 
TRadioButton)<BR>&nbsp;&nbsp;&nbsp;&nbsp; or (ActiveControl is 
TStringGrid)<BR>&nbsp;&nbsp; then<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if Msg.CharCode = VK_RETURN 
then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Msg.CharCode := 
VK_TAB;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
KeyDir:='Next';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
end;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if Msg.Charcode = VK_ESCAPE 
then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
begin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Msg.CharCode := 
VK_TAB;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
KeyDir:='Prev';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
end;<BR>&nbsp;&nbsp;&nbsp;&nbsp; end;<BR>&nbsp;&nbsp; 
inherited;<BR>end;</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</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>&nbsp;</DIV>
<DIV><SPAN class=476092305-22042005><FONT face=Arial color=#0000ff 
size=2>Attached to the form:<BR>&nbsp;&nbsp;&nbsp;&nbsp; procedure 
CMDialogKey(Var Msg: TWMKEY); message CM_DIALOGKEY;</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=476092305-22042005><FONT face=Arial color=#0000ff 
size=2><BR>procedure TMyForm.CMDialogKey(var Msg: TWMKEY);<BR>{<BR>&nbsp;&nbsp; 
This converts ENTER key messages to TAB key messages, provided a 
few<BR>&nbsp;&nbsp; conditions hold<BR>}<BR>begin<BR>&nbsp;&nbsp; if&nbsp;&nbsp; 
(ActiveControl is TCustomEdit)<BR>&nbsp;&nbsp;&nbsp;&nbsp; or (ActiveControl is 
TDBCode)<BR>&nbsp;&nbsp;&nbsp;&nbsp; or (ActiveControl is 
TPageControl)<BR>&nbsp;&nbsp;&nbsp;&nbsp; or (ActiveControl is 
TDBLookupComboBox)<BR>&nbsp;&nbsp;&nbsp;&nbsp; or (ActiveControl is 
TDBComboBox)<BR>&nbsp;&nbsp; then<BR>&nbsp;&nbsp;&nbsp;&nbsp; if Msg.CharCode = 
VK_RETURN then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Msg.CharCode := 
VK_TAB;<BR>&nbsp;&nbsp; inherited;<BR>end;<BR></FONT></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</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&nbsp; mobile&nbsp;(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>&nbsp;</P>
<P class=MsoAutoSig><o:p><!--StartFragment -->&nbsp;</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&nbsp; 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>