VBでデバックすると下のようなエラーがでます
ArgumentNullExceptionはハンドルされませんでした。
値を Null にすることはできません。
パラメーター名: activationContext
VBを初めて日が浅いのでヘルプを読んでも意味が理解できませんでした。
なので、易しく回答してもらえると嬉しいです
コードは下です
Public Class Form1
'TextBox2に入力したURLをWebBrowser1で表示する
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
WebBrowser1.Navigate(TextBox2.Text)
End Sub
'ブラウザ→戻るでWebBrowser1を処理する
Private Sub 戻るToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 戻るToolStripMenuItem.Click
WebBrowser1.GoBack()
End Sub
'ブラウザ→進むでWebBrowser1を処理する
Private Sub 進むToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 進むToolStripMenuItem.Click
WebBrowser1.GoForward()
End Sub
'ブラウザ→テキストボックスにURLを入力した時の処理
Private Sub ToolStripTextBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripTextBox1.Click
WebBrowser1.Navigate(ToolStripTextBox1.Text)
End Sub
'TextPageのタブをクリックした時のイベント
Private Sub TabPage1_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles TabPage1.Enter
TextBox2.Visible = False
Button1.Visible = False
ブラウザToolStripMenuItem.Enabled = False
書式ToolStripMenuItem.Enabled = True
ToolStripMenuItem1.Enabled = True
End Sub
'BrowserPageのタブをクリックした時のイベント
Private Sub TabPage2_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles TabPage2.Enter
TextBox2.Visible = True
Button1.Visible = True
ブラウザToolStripMenuItem.Enabled = True
書式ToolStripMenuItem.Enabled = False
ToolStripMenuItem1.Enabled = False
End Sub
Private Sub 新規ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 新規ToolStripMenuItem.Click
TextBox1.Text = ("")
End Sub
Private Sub 開くToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 開くToolStripMenuItem.Click
Dim selectButton As DialogResult
Dim filename As String
selectButton = OpenFileDialog1.ShowDialog()
filename = OpenFileDialog1.FileName
If selectButton = DialogResult.OK Then
Try
TextBox1.Text = _
My.Computer.FileSystem.ReadAllText(filename, System.Text.Encoding.Default)
Me.Text = "Visual Text" & filename
Catch ex As Exception
End Try
End If
End Sub
Private Sub 保存ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 保存ToolStripMenuItem.Click
Dim selectButton As DialogResult
Dim filename As String
selectButton = SaveFileDialog1.ShowDialog()
filename = SaveFileDialog1.FileName
If selectButton = DialogResult.OK Then
Try
My.Computer.FileSystem.WriteAllText(filename, TextBox1.Text, False, System.Text.Encoding.Default)
Me.Text = "Visual Text" & filename
Catch ex As Exception
End Try
End If
End Sub
Private Sub フォントToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles フォントToolStripMenuItem.Click
Dim fd As New FontDialog()
fd.Font = TextBox1.Font
fd.Color = TextBox1.ForeColor
fd.MaxSize = 19
fd.MinSize = 8
fd.FontMustExist = True
fd.AllowVerticalFonts = False
fd.ShowColor = True
fd.ShowEffects = True
fd.FixedPitchOnly = False
fd.AllowVectorFonts = True
If fd.ShowDialog() <> DialogResult.Cancel Then
'TextBox1のフォントと色を変える
TextBox1.Font = fd.Font
TextBox1.ForeColor = fd.Color
End If
End Sub
End Class