Home All Groups Group Topic Archive Search About

Trouble with sendkey TAB

Author
23 Nov 2007 5:18 AM
kru
Hi All,

Simple question yet I can't figure it out.

I need to send the TAB key to an external application.

It is able to send {ENTER} etc yet no luck with the {TAB}.

I have tried the following:

My.Computer.Keyboard.SendKeys(Keys.Tab) ' sends a 9 instead?
My.Computer.Keyboard.SendKeys("{TAB}") ' does nothing
SendKeys.SendWait("{TAB}") ' does nothing

Any suggestions?

Author
23 Nov 2007 12:44 PM
Armin Zingler
Show quote Hide quote
"kru" <krus***@gmail.com> schrieb
> Hi All,
>
> Simple question yet I can't figure it out.
>
> I need to send the TAB key to an external application.
>
> It is able to send {ENTER} etc yet no luck with the {TAB}.
>
> I have tried the following:
>
> My.Computer.Keyboard.SendKeys(Keys.Tab) ' sends a 9 instead?
> My.Computer.Keyboard.SendKeys("{TAB}") ' does nothing
> SendKeys.SendWait("{TAB}") ' does nothing
>
> Any suggestions?

Yes: Enable Option Strict On. (Please MSFT, make this the default!!!)

Though, doesn't solve the problem. I tried it with Notepad and it works
well.


Armin
Author
26 Nov 2007 12:21 AM
kru
Show quote Hide quote
On Nov 23, 11:44 pm, "Armin Zingler" <az.nos***@freenet.de> wrote:
> "kru" <krus***@gmail.com> schrieb
>
> > Hi All,
>
> > Simple question yet I can't figure it out.
>
> > I need to send the TAB key to an external application.
>
> > It is able to send {ENTER} etc yet no luck with the {TAB}.
>
> > I have tried the following:
>
> > My.Computer.Keyboard.SendKeys(Keys.Tab) ' sends a 9 instead?
> > My.Computer.Keyboard.SendKeys("{TAB}") ' does nothing
> > SendKeys.SendWait("{TAB}") ' does nothing
>
> > Any suggestions?
>
> Yes: Enable Option Strict On. (Please MSFT, make this the default!!!)
>
> Though, doesn't solve the problem. I tried it with Notepad and it works
> well.
>
> Armin

Hi Armin,

I tried with Option Strict On and I still have the same problem with
not being able to send {TAB} to this particular program. What's
interesting to note is that it does work fine for other applications
like Notepad. I know another developer has incorporated sending TAB
with SendMessage and it works fine. I haven't looked into it too much
as I originally hoped not to spend this much time trying to get a TAB
to send.

If anyone else has any ideas why it may not be tabbing let me know
please.

The application I'm sending it to is a legacy application which is
text only and must be at least 15 years old
Author
24 Nov 2007 12:58 PM
Herfried K. Wagner [MVP]
"kru" <krus***@gmail.com> schrieb:
> I need to send the TAB key to an external application.
>
> It is able to send {ENTER} etc yet no luck with the {TAB}.
>
> I have tried the following:
>
> My.Computer.Keyboard.SendKeys(Keys.Tab) ' sends a 9 instead?

This is not intended to work.  'SendKeys' expects a string.

> My.Computer.Keyboard.SendKeys("{TAB}") ' does nothing
> SendKeys.SendWait("{TAB}") ' does nothing

According to the documentation, these calls should work.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>
Author
26 Nov 2007 12:22 AM
kru
On Nov 24, 11:58 pm, "Herfried K. Wagner [MVP]" <hirf-spam-me-
h***@gmx.at> wrote:
Show quoteHide quote
> "kru" <krus***@gmail.com> schrieb:
>
> > I need to send the TAB key to an external application.
>
> > It is able to send {ENTER} etc yet no luck with the {TAB}.
>
> > I have tried the following:
>
> > My.Computer.Keyboard.SendKeys(Keys.Tab) ' sends a 9 instead?
>
> This is not intended to work.  'SendKeys' expects a string.
>
> > My.Computer.Keyboard.SendKeys("{TAB}") ' does nothing
> > SendKeys.SendWait("{TAB}") ' does nothing
>
> According to the documentation, these calls should work.
>
> --
>  M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
>  V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>

I had a read also and they should work, wonder what the issue could
be.. sending ENTER etc all work fine hmmm