Не добавляется элемент в List(of Custom Class) из
функции webcontrol.WebView.BeforeRequestLoad
Private Sub Captcha_Load(sender As Object, e As EventArgs) Handles MyBase.Load
webcontrol = New WebControl
webcontrol.WebView = New WebView
webcontrol.WebView.Engine = engine
webcontrol.Dock = DockStyle.Fill
Panel1.Controls.Add(webcontrol)
webcontrol.WebView.LoadHtml("http://google.com")
Form1.UC_tasks1.CaptchaKeysList.Add(New CaptchaKey("Test1", 10))
AddHandler webcontrol.WebView.BeforeRequestLoad, AddressOf BeforeRequestLoad
End Sub
Public Sub BeforeRequestLoad(sender As Object, e As BeforeRequestLoadEventArgs)
Form1.UC_tasks1.CaptchaKeysList.Add(New CaptchaKey("Test", 10))
End Sub
Public Class CaptchaKey
Public Key As String
Public Time As Integer
Sub New(Key As String, Time As Integer)
Me.Key = Key
Me.Time = Time
End Sub
End Class
Зеленым работает, красным - нет