Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
WebBrowser1.Select()
SendKeys.Send("^f")


This code works fine if i had browser IE6 or IE7.

But for IE8 it does not work...
It always results as "Not found"..
Posted
Updated 21-Apr-21 11:55am
v2

I got the solution by trial & error:

On Page_Load i used to write my HTML string (strHTML) like..
    WebBrowser1.Navigate("about:blank")
WebBrowser1.Document.Write(strHTML)


& on FindButton_Click
WebBrowser1.Select()
SendKeys.Send("^f")

this will alternate option of pressing Ctrl+F to find any string on Web Browser..

Now this code works fine for IE6 & IE7.
But if I have IE8 then "find window" is unable to find anything..

Now, if i wrote
WebBrowser1.DocumentText = strHTML

in Page_Load after writing my strHTML to WebBrowser, it worked for me..

I think the problem was that IE8 cant find where it has to find, since navigate URL is "about:blank" So, we have to specify "DocumentText" property..

But this is my guess only, if anybody know the exact reason plz post ur reply...
 
Share this answer
 
Dim doc As HTMLDocument
Set doc = frm.WebBrowser1.Document
doc.focus
SendKeys "^f", True
 
Share this answer
 
Comments
Richard Deeming 22-Apr-21 4:10am    
An unexplained code-dump in the wrong language - you are using VB6, whereas the OP was using VB.NET - is not a "solution" to this ancient and already-solved question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900