Windows 10 Pro
Microsoft Visual Studio Community 2019
Version 16.11.7
VisualStudio.16.Release/16.11.7+31911.196
Microsoft .NET Framework
Version 4.8.04084
Installed Version: Community
I have an app that reads data from two different web pages and copies the data to a textbox.
Earlier this year,I had to switch to webview2 since the webpage I was going to wouldn't recognize netscape7 which is what the webbrowser control won't recognize it any longer. I used the old webbrowser control for the second webpage somce it couold select all of the page, copy it, set focus to the textbox and copy the data to the textbox with no problems .
I updated my code and decided to change both webbrowsers to webview2 in case the second webpage would stop using netscape as well. After I updated my code, ran into a problem. Webview2 doesn't highlight the data when I use ctrl a programically. I went back to the old webbrowser and it works again.
Bad code:
[code]
Public Sub Load_text_Box_Two()
Clipboard.Clear()
TXTBRK1.Clear()
Webview21.focus
SendKeys.SendWait("^a") 'ctrl+a
SendKeys.SendWait("^c") 'ctrl+c
Textbox.Focus()
SendKeys.SendWait("^v") ' paste.Focus()
'It copies text from the web into a textbox
End Sub
[/code]
Code that works.
[code]
Public Sub Load_text_Box_Two()
Clipboard.Clear()
TXTBRK1.Clear()
webbrowser1.Focus()
SendKeys.SendWait("^a") 'ctrl+a
SendKeys.SendWait("^c") 'ctrl+c
Textbox.Focus()
SendKeys.SendWait("^v") ' paste.Focus()
'It copies text from the web into a textbox
End Sub
[/code]
I searched the web for a solution, but evidently, I not searching for the right thing. From what little I was able to find, It appears to be a bug in webview2. Someone said to install the pre-release version of Webview2. I did that to no avail. Is there a way to programmically select all and copy from webview2? Thanks