RE: TZF - Tab - Enter - and Edit Components

"Randall H. Carpenter" <[email protected]> Fri, 6 Feb 2004 12:33:51 -0500
Newsgroups gmane.comp.lang.delphi.topaz
Message-ID <[email protected]>
Bob,

The Topaz TTzEdit component has a property name TabOnEnter.  Set it to true and the enter key works just like the tab key.  For other TEdit components, comboboxes, checkboxes, etc. which do not have such a property, you will have to capture the keystroke in the OnKeyPress event of the component.  For instance, for a combobox named MyCombobox the OnKeyPress routine would look like this:

procedure MyUnit.MyComboboxKeyPress(Sender: TObject; var Key: Char);
begin
  inherited;
  (* Make the ENTER key act as the tab key *)
  if Key = chr(VK_RETURN) then
    begin
      SelectNext(ActiveControl as tWinControl, TRUE, TRUE);
      Key := #0;
    end;
end;


Randall H. Carpenter



-----Original Message-----
From: Bob Watson [mailto:[email protected]]
Sent: Friday, February 06, 2004 12:16 PM
To: [email protected]
Subject: TZF - Tab - Enter - and Edit Components



I have an "old" customer - in many ways.
And I am upgrading a DOS program to
Windows.  They really DO NOT like the
TAB key and want the ENTER key to
do what the TAB key does.  I have "almost"
got this perfected, but there are instances
where it just does not work.  Is there
an easy way to do this?  For instance, if
the system "sees" an ENTER key, change
it to TAB.

Thanks for any help, 
Bob

--^----------------------------------------------------------------
This email was sent to: [email protected]

EASY UNSUBSCRIBE click here: http://topica.com/u/?clvXPN.a5kvff.Z2NsZHQt
Or send an email to: [email protected]

TOPICA - Start your own email discussion group. FREE!
http://www.topica.com/partner/tag02/create/index2.html
--^----------------------------------------------------------------