unit StringInp;

interface

uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls, 
  Buttons, ExtCtrls;

type
  TStringInputDlg = class(TForm)
    OKBtn: TButton;
    CancelBtn: TButton;
    Bevel1: TBevel;
    Edit: TEdit;
    procedure EditKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  StringInputDlg: TStringInputDlg;

implementation

{$R *.DFM}

procedure TStringInputDlg.EditKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if(Key=VK_RETURN) then
    ModalResult:=mrOk;
end;

procedure TStringInputDlg.FormShow(Sender: TObject);
begin
  FocusControl(Edit);
end;

end.
