View Single Post
Join Date: Aug 2008
Posts: 710
Reputation: Teme64 will become famous soon enough Teme64 will become famous soon enough 
Solved Threads: 114
Teme64's Avatar
Teme64 Teme64 is offline Offline
Master Poster

Re: send text to browser text field

 
0
  #3
Jan 14th, 2009
First, this is Visual Basic 4 / 5 / 6 i.e. classic VB forum. You're question is about VB.NET which has it's own forum here in DaniWeb.

WebBrowser1.Focus() sets the focus to the webbrowser control but there's no guarantee where the focus is in the web page its displaying.

Anyway, I got following key sequence to work:
  1. WebBrowser1.Focus()
  2. SendKeys.SendWait("+{TAB}") ' Tab back one step
  3. SendKeys.SendWait("{TAB}") ' Tab forward one step
  4. SendKeys.SendWait("userID")
  5. SendKeys.SendWait("{TAB}")
  6. SendKeys.SendWait("password")
  7. SendKeys.SendWait("{Enter}")
Reply With Quote