Public Class Form1 Dim myUri As Uri = New Uri("https://www.yahoo.co.jp/") Dim HtmlData As String WithEvents myWebClient As New WebClient Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click myWebClient.Encoding = Encoding.UTF8 myWebClient.DownloadStringAsync(myUri) myWebClient.CancelAsync() myWebClient.DownloadStringAsync(myUri) ←ここでエラー発生! End Sub Private Sub myWebClient_DownloadStringCompleted(sender As Object, e As DownloadStringCompletedEventArgs) Handles myWebClient.DownloadStringCompleted If e.Error Is Nothing Then HtmlData = CStr(e.Result) MsgBox(HtmlData.Substring(0, 1000)) ElseIf e.Cancelled Then MsgBox("キャンセルボタンが押されました。") End If End Sub End Class