Public Class Form1 Dim int As Integer = 0 Dim Browser As New WebBrowser Private Sub Done(ByVal sender As System.Object,e As Windows.Forms.WebBrowserDocumentCompletedEventArgs) ToolStripTextBox2.Text = CType(TabControl1.SelectedTab.Controls.Item(0),WebBrowser).Url.ToString '上の行でここでエラーが起きる TabControl1.SelectedTab.Text = CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).DocumentTitle End Sub (中略) End Class