Home All Groups Group Topic Archive Search About

Enter-key to have tab-key functionality

Author
8 May 2006 8:25 PM
Nano
Hi,

I have an application written in vb (2003 dotnet 1.1) which requires a lot
of user input, mostly numeric. Now I would like to jump from textbox-to-
textbox when pressing the enter-key, just like using the tab-key.

I found I have problems with just using .SelectNextControl, when for
example the next control is (temporarily) invisible.

Should I just override:
ProcessCmdKey(ByRef msg As Windows.Forms.Message, ByVal keyData As
Windows.Forms.Keys)

Or is there a regular best-practise for this issue?

Thanks for any suggestions/solutions in advance!

Nano

Author
8 May 2006 10:40 PM
Melissa Nava
You may try this guys suggestion:
http://blogs.duncanmackenzie.net/duncanma/archive/2004/12/13/936.aspx

Just an idea.
Author
8 May 2006 11:03 PM
Nano
"Melissa Nava" <melissa.n***@gmail.com> wrote in
news:1147128048.316884.271670@i39g2000cwa.googlegroups.com:

> http://blogs.duncanmackenzie.net/duncanma/archive/2004/12/13/936.aspx

Thanks very much, that looks just perfect! I'll try that asap!

Nano
Author
9 May 2006 12:13 AM
Dennis
Not sure I understand.  If the control is "temporairly invisible" then you
can't set the focus to the control.  Am I missing something?
--
Dennis in Houston


Show quoteHide quote
"Nano" wrote:

> Hi,
>
> I have an application written in vb (2003 dotnet 1.1) which requires a lot
> of user input, mostly numeric. Now I would like to jump from textbox-to-
> textbox when pressing the enter-key, just like using the tab-key.
>
> I found I have problems with just using .SelectNextControl, when for
> example the next control is (temporarily) invisible.
>
> Should I just override:
> ProcessCmdKey(ByRef msg As Windows.Forms.Message, ByVal keyData As
> Windows.Forms.Keys)
>
> Or is there a regular best-practise for this issue?
>
> Thanks for any suggestions/solutions in advance!
>
> Nano
>
Author
9 May 2006 9:02 AM
Nano
=?Utf-8?B?RGVubmlz?= <Den***@discussions.microsoft.com> wrote in
news:987A99CE-2B7E-4A8F-811D-034F20ADAACD@microsoft.com:

> Not sure I understand.  If the control is "temporairly invisible" then
> you can't set the focus to the control.  Am I missing something?

You are right, that's why I got an error when using SelectNextControl.
Although the control is invisible, it may be still the next control (which
can not be focused/selected when invisible).

Nano