🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.delphi.databases
Article #38

Changing ENTER as TAB in edit controls - Odd behaviors

#38
From: Bill Artemik
Date: Mon, 04 Oct 1999 00:00
54 lines
2361 bytes
I'm using the new and improved Delphi 5. I have a client that wants a
standard edit window with some dbEdit controls.

Using a TEdit control to filter the table the user wants to use the
ENTER key to move from field to field. 

I have tried the following examples to get this to work:

In the Form's OnKeyDown event (KeyPreview on)

   if (key=vk_Return) then
      if (Shift = []) then
          SelectNext(ActiveControl,True,True)
      else if (Shift = [ssShift]) then
          SelectNext(ActiveControl,False,True);

When I hit enter from the TEdit control I move to the first DbEdit
control just fine but after entering data and hitting ENTER I go NO
WHERE! 

Then I tried:

Procedure TfrmDataEntry.CMDialogKey( Var Msg: TWMKey );
Begin
   If NOT (ActiveControl Is TButton) Then
      If Msg.Charcode = 13 Then
         Msg.Charcode := 9;
   inherited;
End;

With this procedure as part of the form's PRIVATE declaration. NOTHING
from this, either.

Is there something WIERD about DBEdit controls that trashes the enter
key?

Does anyone have any suggestions (other than getting the user to
concede using the TAB key instead, of course...this is NOT an option
on this program...)

Thanks for any help!

Bill



Bill Artemik
Programmer / Analyst
Droste Consultants, Inc.
bill@droste1.com


"There are THREE kinds of people in the world...
      Those that can count and those that can't."
Technical Details
Message-ID: <37f8a6e1.234810900@news-west.newscene.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: ff75c,b923747c15d92b7a,start
X-Google-Attributes: gidff75c,public
X-Google-Thread: ffff5,b923747c15d92b7a,start
X-Google-Attributes: gidffff5,public
X-Google-Thread: 1043cf,b923747c15d92b7a,start
X-Google-Attributes: gid1043cf,public
X-Google-Thread: 10de66,b923747c15d92b7a,start
X-Google-Attributes: gid10de66,public
From: bill@droste1.com (Bill Artemik)
Subject: Changing ENTER as TAB in edit controls - Odd behaviors
Date: 1999/10/04
Message-ID: <37f8a6e1.234810900@news-west.newscene.com>
X-Deja-AN: 532635949
Content-Transfer-Encoding: 7bit
Organization: Droste Consultants, Inc.
Content-Type: text/plain; charset=us-ascii
MIME-Version: 1.0
Reply-To: bill@droste1.com
Newsgroups: comp.lang.pascal.delphi.databases,borland.public.delphi.database.desktop,borland.public.delphi.database.sqlservers,borland.public.delphi.objectpascal