Home All Groups Group Topic Archive Search About
Author
15 Nov 2006 10:29 AM
Peter Newman
vb.net 2005

im trying to move focus from one control to another using the tab index.
For varios reasons i don not want to use send keys or control.focus.

Author
15 Nov 2006 2:36 PM
Herfried K. Wagner [MVP]
"Peter Newman" <PeterNew***@discussions.microsoft.com> schrieb:
> im trying to move focus from one control to another using the tab index.
> For varios reasons i don not want to use send keys or control.focus.

Well, calling the control's 'Focus' method is the preferred method.  What
are the reasons you do not want to use this method?

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>
Author
15 Nov 2006 2:44 PM
Peter Newman
what i want to do is when the user hits the return/enter key they tab to the
next control. However i want to put this in a class so that all forms can
inherit it

Show quoteHide quote
"Herfried K. Wagner [MVP]" wrote:

> "Peter Newman" <PeterNew***@discussions.microsoft.com> schrieb:
> > im trying to move focus from one control to another using the tab index.
> > For varios reasons i don not want to use send keys or control.focus.
>
> Well, calling the control's 'Focus' method is the preferred method.  What
> are the reasons you do not want to use this method?
>
> --
>  M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
>  V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>
>
>
Author
16 Nov 2006 4:35 PM
Phill W.
Peter Newman wrote:
> what i want to do is when the user hits the return/enter key they tab to the
> next control. However i want to put this in a class so that all forms can
> inherit it

Probably not best done in the Form, but in the Controls you place onto it.

Call [Control].SelectNextControl() in your override for OnKeyDown (or
OnKeyUp; I can never remember which until my program goes pop!)

Regards,
    Phill  W.