Trouble with sendkey TAB

  • Thread starter Thread starter kru
  • Start date Start date
K

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?
 
kru said:
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
 
kru said:
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.
 
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
 
This is not intended to work. 'SendKeys' expects a string.


According to the documentation, these calls should work.

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