Identifier expected
Hej eksperter.Jeg har problemer med min kode i VB. Jeg får 4 fejl (Identifier expected). Der er en blå streg under de sidste 4 "Private Sub", men siden jeg ikke er en haj til det her aner jeg ikke hvad jeg skal gøre. nogen der kan hjælpe?
Public Class Form1
Private Sub open()
OpenFileDialog1.Filter = "Rich Text Files (*.rtf)|*.rtf" 'Type of files able to open, in this case RTF's
If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then 'If OK, load the file
rtb.LoadFile(OpenFileDialog1.FileName)
End If
End Sub
Private Sub save()
SaveFileDialog1.Filter = "Rich Text Files (*.rtf)|*.rtf" 'Type of files able to save, in this case RTF's
If SaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then 'If OK, save the file
rtb.SaveFile(SaveFileDialog1.FileName)
End If
End Sub
Private Sub
SaveToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripMenuItem.Click 'Onlick Save menu, bring up the save dialog box
save() 'The sub Save
End Sub
Private Sub
OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click 'Onlick Open menu, bring up the open dialog box
open() 'The sub Open
End Sub
Private Sub
FontToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FontToolStripMenuItem.Click 'Onlick Font menu, bring up the font dialog box
If FontDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
rtb.SelectionFont = FontDialog1.Font
End If
End Sub
Private Sub
FontColorToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FontColorToolStripMenuItem.Click 'Onlick Font Color menu, bring up the font color dialog box
If ColorDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
rtb.SelectionColor = ColorDialog1.Color
End If
End Sub
End Class