Re: Enter as Tab in Dialogs

fatih olcer <[email protected]>
Newsgroups gmane.comp.lang.delphi.programming
Message-ID <1058794706.13122.45.camel@fatihev>
// Form1.KeyPreview := True ! 
// Form1.KeyPreview := True ! 
// Form1.KeyPreview := True ! 
// Form1.KeyPreview := True ! 
// Form1.KeyPreview := True ! 

procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char); 
begin 
  if Key = #13 then 
  begin 
    Key := #0; 
    { check if SHIFT - Key is pressed } 
    if GetKeyState(VK_Shift) and $8000 <> 0 then 
      PostMessage(Handle, WM_NEXTDLGCTL, 1, 0) 
    else 
      PostMessage(Handle, WM_NEXTDLGCTL, 0, 0); 
  end; 
end;

// Form1.KeyPreview := True ! 
// Form1.KeyPreview := True ! 
// Form1.KeyPreview := True ! 
// Form1.KeyPreview := True ! 

21-07-2003 Pazartesi günü saat 09:35 sularında, Garry Searle dedi ki:
> I am trying to make the Enter key act like the TAB key in dialogs. In forms
> it seems to work but not a dialog. Pressing an alpha key runs the procedure
> but not the enter or arrow keys.
> 
> I set Keypreview to true
> 
> procedure TPaymentsDlg.Edit1KeyPress(Sender: TObject; var Key: Char);
> begin
>    showmessage('key pressed');
>    if Key=Chr(VK_Return) Then Begin
>       Perform(wm_NextDlgCtl,0,0);
> 	    Key := #0;
>    End;
> end;
> 
> Any suggestions?
> 
> Thanks Garry
> 
> 
> 
> CodeCoffer - new Delphi code protection Tool!
> http://www.delphicollection.com/public/CodeCoffer.htm
> ---------------------------------------------------------------
> Unsubscribe:[email protected]
> List owner:[email protected]
> --------------------------------------------------------------- 
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
> 
> 


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Natural Vitamins for Good Prostate & Male Health. $28.97
http://www.challengerone.com/t/l.asp?cid=2865&lp=prosta2.html
http://us.click.yahoo.com/qJIe0D/89VGAA/ySSFAA/i7folB/TM
---------------------------------------------------------------------~->

CodeCoffer - new Delphi code protection Tool!
http://www.delphicollection.com/public/CodeCoffer.htm
---------------------------------------------------------------
Unsubscribe:[email protected]
List owner:[email protected]
--------------------------------------------------------------- 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.