!!!! Enter Key -> Tab Key 
Author Message
 !!!! Enter Key -> Tab Key

Please Help!!

How can I use Enter Key to move from one component to another in a Form?

Any help appreciated.

--
/////////////////////////////////////////////////////////////
   0   0       regards

     ==        jonathan yeo
    hello                                                          
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\



Wed, 18 Jun 1902 08:00:00 GMT  
 !!!! Enter Key -> Tab Key

Quote:

> Please Help!!

> How can I use Enter Key to move from one component to another in a Form?

> Any help appreciated.

> --
> /////////////////////////////////////////////////////////////
>    0   0       regards

>      ==        jonathan yeo
>     hello
> \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

handle the onkeypress event with something like this:-

 proc MyForm.OnKeyPress ...
 begin
   if (Key = #13) then begin
     NewForm.SetFocus;  // go to your new form
     Key := #0;  // get rid of beep!
   end;
 end;

Good luck;

Railton....



Wed, 18 Jun 1902 08:00:00 GMT  
 !!!! Enter Key -> Tab Key


Quote:
>How can I use Enter Key to move from one component to another in a Form?

In your form's OnKeyPress handler, add the following code:

if Key = #13 {Enter} then begin
  Perform(wm_NextDlgCtl, 0, 0); {Move to next control}
  Key := #0; {Prevent further attempts to process keystroke}
end; {Key = #13}

--
To a man who only has Visual Basic, everything looks like a control array.



Wed, 18 Jun 1902 08:00:00 GMT  
 !!!! Enter Key -> Tab Key

Try this

If you want to use the enter key as a tab key you might try this in the
OnKeyPress event of your form. Be sure keypreview is set to true.

if key=#13 then
  begin
    {change focus to next control}
    SelectNext(ActiveControl as TWinControl, True, True);
    {Clear "key" to skip default handling}
    Key:=#0;
    exit;
  end;

Chris



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How do I make the Enter key act like the Tab key

2. using enter key instead of tab key for data entry

3. Enter key instead of TAB key

4. Using ENTER Key instead of TAB

5. Enter key as Tab in TDBGrid

6. Navigating in DBGrid using <enter>- key

7. How do I make Enter Key Behave Like Tab Keys In DB Grid ?

8. Using the enter key to advance

9. Answering a Question by Pressing the Enter Key

10. Enter key to rotate components

11. TDBNavigator Using Enter Key

12. Moving between DBedit fields with enter key

 

 
Powered by phpBB® Forum Software