Reputation: 25
I want to press enter key by VB.NET...I tried lots of codes but no one worked.
I tried:
SendKeys.Send("(Enter)")
SendKeys.Send(Keys.Enter)
SendKeys.Send("Enter")
What can I do?
Upvotes: 0
Views: 7068
Reputation: 54562
In addition to what Andy states, Visual Basic has some default Constants built in. Try using vbCrLf
or vbCR
all of them will work.
i.e.
SendKeys.Send(vbCrLf)
or
SendKeys.Send(vbCr)
Upvotes: 1
Reputation: 2892
I haven't tried it, but from this link in MSDN Library: http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.send.aspx
...you should be using:
SendKeys.Send("{ENTER}")
or
SendKeys.Send("~")
Upvotes: 3