erreur addhandler avec un classe
Bonjour,
j'arrive a résoudre mon problème par rapport a une classe les deux erreurs .
Code:
1 2 3 4 5 6 7 8 9 10 11
| Private Sub btn1_Click(sender As Object, e As EventArgs) Handles btn1.Click
Dim downloader As FileDownloader
...etc
Dim start As ThreadStart = New ThreadStart(AddressOf downloader.StartDownload)
AddHandler downloader.DownloadStarting, New FileDownloader._delDownloadStarting(AddressOf Me.download_DownloadStarting)
AddHandler downloader.DownloadCompleted, New FileDownloader._delDownloadCompleted(AddressOf Me.download_DownloadCompleted)
Dim thread As New Thread(start) With { _
.Name = item.Text _
}
Me._threads.Add(thread)
...etc |
message erreur : 'DownloadCompleted' n'est pas un événement de 'downloader_Multiple_Files.FileDownloader' et 'DownloadStarting' n'est pas un événement de 'downloader_Multiple_Files.FileDownloader'
dans la classe Filedownloader :
Code:
1 2 3 4 5
| Public DownloadStarting As _delDownloadStarting
Public DownloadCompleted As _delDownloadCompleted
Public Delegate Sub _delDownloadCompleted(ByVal thread As FileDownloader, ByVal isSuccess As Boolean)
Public Delegate Sub _delDownloadStarting(ByVal thread As FileDownloader) |
Pouvez-vous m'aider a résoudre ce problème par rapport a une classe. Merci de votre réponse:roll: