Rank: Member Groups: Member
Joined: 3/21/2020 Posts: 12
|
Code: Visual Basic.NET
Public threadRunner As ThreadRunner, Wv As WebView, eng As EO.WebEngine.Engine, cachefolder As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
exePath = Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase
exePath = New Uri(exePath).LocalPath
ExeDir = Path.GetDirectoryName(exePath)
cachefolder = ExeDir & "\test"
EO.Base.Runtime.EnableEOWP = True
Dim options As New EO.WebEngine.BrowserOptions
options.EnableWebSecurity = True
EO.WebBrowser.Runtime.SetDefaultBrowserOptions(options)
eng = EO.WebEngine.Engine.Create("test")
eng.Options.CachePath = cachefolder
WebView1.Engine = eng
WebView1.Create(PictureBox3.Handle)
WebView1.LoadUrl("https://www.essentialobjects.com/")
End Sub
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
Try
eng.Stop(False)
WebView1.StopLoad()
WebView1.Close(True) : WebView1.Destroy() : WebView1.Dispose()
Catch
End Try
End
End Sub
When you run a program, then close it, and immediately rerun it again, it often happens that WebView can't display any pages。 This is really distressing. What is the reason for this ??how to fix codes? THX :)
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
We are not aware of such problems. Can you isolate the problem into a small test app and send the test app to us? See here for more details: https://www.essentialobjects.com/forum/test_project.aspxThanks!
|
Rank: Member Groups: Member
Joined: 3/21/2020 Posts: 12
|
Thank you. I've solved my problem
|