To reuse a Webview2 control from a previously closed window. (VB.NET Code)
Private Sub Form_Main_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Form2.Webview_Form2.Source = New Uri("about:blank")
End Sub
Private Sub OpenForm2()
if PreviouslyLoaded = True Then ReinitializeWebView_Form2()
Form2.WebView_Form2.Source = New Uri("https://www.google.com/")
PreviouslyLoaded = True
Form2.Show()
End Sub
Private Async Sub ReinitializeWebView_Form2()
Await Form2.WebView_Form2.EnsureCoreWebView2Async()
End Sub
To reuse a Webview2 control from a previously closed window. (VB.NET Code)