Home All Groups Group Topic Archive Search About

Enter Key vs. Tab Key

Author
1 Dec 2006 9:45 PM
Michael Cook
In my data entry forms, I want to treat the Enter key on text box as though
the user has pressed the tab key and jump to the next control. In VB6 I would
do this by using the SendKeys "{Tab}" routine. What is the best practice for
Visual Basic .NET?

Author
2 Dec 2006 7:09 AM
Michel Posseth [MCP]
Well , we just set the keypreview  of the form to true and what do you think
?? we catch the enter key and send a tab with sendkeys ...


:-) as you see not so much has changed

regards

Michel posseth [MCP]


Show quoteHide quote
"Michael Cook" <MichaelC***@discussions.microsoft.com> schreef in bericht
news:182A316F-9D07-4997-AA23-34AB981C4F98@microsoft.com...
> In my data entry forms, I want to treat the Enter key on text box as
> though
> the user has pressed the tab key and jump to the next control. In VB6 I
> would
> do this by using the SendKeys "{Tab}" routine. What is the best practice
> for
> Visual Basic .NET?
Author
4 Dec 2006 4:28 PM
Michael Cook
What about my text boxes with multiple lines that I don't want to interpret
the ENTER key as the TAB key. I think the KEYPREVIEW will be global on the
form? Is there a Microsoft recommended method? I thought in VB6 using
SendKeys as this solution was not encouraged by Microsoft.

- Michael

Show quoteHide quote
"Michel Posseth  [MCP]" wrote:

> Well , we just set the keypreview  of the form to true and what do you think
> ?? we catch the enter key and send a tab with sendkeys ...
>
>
> :-) as you see not so much has changed
>
> regards
>
> Michel posseth [MCP]
>
>
> "Michael Cook" <MichaelC***@discussions.microsoft.com> schreef in bericht
> news:182A316F-9D07-4997-AA23-34AB981C4F98@microsoft.com...
> > In my data entry forms, I want to treat the Enter key on text box as
> > though
> > the user has pressed the tab key and jump to the next control. In VB6 I
> > would
> > do this by using the SendKeys "{Tab}" routine. What is the best practice
> > for
> > Visual Basic .NET?
>
>
>
Author
4 Dec 2006 5:52 PM
Michel Posseth [MCP]
Well , you can code around the mentioned issue ( boolean flag  wether to
send the tab or not )

about the in VB6 not encouraged thingy afaik was this because the need of an
API to perform a sendkey in VB.Net it is part of the framework

in  my opinion you only have 2 options

1. code the behavior that you want

2. use the controls out of the box and live with there habits and
limitations


regards

Michel



Show quoteHide quote
"Michael Cook" <MichaelC***@discussions.microsoft.com> schreef in bericht
news:E68ED773-8996-404D-81E6-8B84B680188C@microsoft.com...
> What about my text boxes with multiple lines that I don't want to
> interpret
> the ENTER key as the TAB key. I think the KEYPREVIEW will be global on the
> form? Is there a Microsoft recommended method? I thought in VB6 using
> SendKeys as this solution was not encouraged by Microsoft.
>
> - Michael
>
> "Michel Posseth  [MCP]" wrote:
>
>> Well , we just set the keypreview  of the form to true and what do you
>> think
>> ?? we catch the enter key and send a tab with sendkeys ...
>>
>>
>> :-) as you see not so much has changed
>>
>> regards
>>
>> Michel posseth [MCP]
>>
>>
>> "Michael Cook" <MichaelC***@discussions.microsoft.com> schreef in bericht
>> news:182A316F-9D07-4997-AA23-34AB981C4F98@microsoft.com...
>> > In my data entry forms, I want to treat the Enter key on text box as
>> > though
>> > the user has pressed the tab key and jump to the next control. In VB6 I
>> > would
>> > do this by using the SendKeys "{Tab}" routine. What is the best
>> > practice
>> > for
>> > Visual Basic .NET?
>>
>>
>>