Found two problems, help to have a look.
webview2 loading objects is slow, can you do an asynchronous version, as long as you set the URL, the background will automatically create, create an event after completion. And then go to the website
HTML Code:Set Webview1 = New_c.WebView2 Webview1.BindTo(UserControl.hWnd)Url without http added will Navigate and crash Webview1.Navigate "baidu.comCode:Set Webview1 = New_c.WebView2 webview1.NewWebViewAnsy(picture1.hwnd,URL AS STRING) SUB NewWebViewAnsy(ParentHwnd as long,Url1) IN CreateThread or ansy Webview1.BindTo(UserControl.hWnd) raiseevent WebviewLoadOK() Webview1.Navigate URL1 end sub




Reply With Quote