[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Using Enter/Return insteat of Tabs

Posted on 2000-04-23
3
Medium Priority
?
144 Views
Last Modified: 2010-04-04
Developing in Delphi5 I need to default the total system to accept Enter/Return instead of Tab.
Is there a global instruction I can give the Project to default to this setting, and if so, what is it.

Thanks

Ben

0
Comment
Question by:BenPols
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Expert Comment

by:Gurkan
ID: 2742950
Hi,
Just go to www.undu.com and download the free component (with source) doing that.
0
 
LVL 3

Accepted Solution

by:
f15iaf earned 150 total points
ID: 2742988
set  form1.keypreview to "true"
and set property "tabstop" in all controls to "false";

and write this code:

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    procedure FormCreate(Sender: TObject);
    procedure FormKeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  i:integer;
implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);{oncreate}
begin
        i:=0;
end;

procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);{onkeypress}
begin
        if(key=chr(13))then
        begin
                if(i=form1.ControlCount-1)then
                i:=0
                else
                i:=i+1;
                form1.activecontrol:=Twincontrol(form1.controls[i]);

        end;

end;

end.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 2743090
hi benpols,

assign all OnKeypress-events of the controls,
where you want to perform this, to this procedure:

procedure TForm1.EditKeyPress(Sender: TObject; var Key: Char);
begin
  if (key = #13)  then
  begin
    PostMessage(Self.Handle,WM_NEXTDLGCTL,0,0);
    key := #0;
  end;
end;

meikl
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question