Imports System.IO
Public Class Form1
Private Sub ÖffnenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ÖffnenToolStripMenuItem.Click
RichTextBox1.Text = ""
Dim sr As New StreamReader("Datei.txt")
While Not sr.EndOfStream
RichTextBox1.Text = RichTextBox1.Text & sr.ReadLine & vbCrLf
End While
sr.Close()
End Sub
Private Sub SpeichernToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SpeichernToolStripMenuItem.Click
Dim sw As New StreamWriter("Datei.txt")
For Each line As String In RichTextBox1.Lines
sw.WriteLine(line)
Next
sw.Close()
End Sub
Private Sub ÜberToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ÜberToolStripMenuItem.Click
Form2.Show()
End Sub
End Class
Public Class Form1
Private Sub ÖffnenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ÖffnenToolStripMenuItem.Click
RichTextBox1.Text = ""
Dim sr As New StreamReader("Datei.txt")
While Not sr.EndOfStream
RichTextBox1.Text = RichTextBox1.Text & sr.ReadLine & vbCrLf
End While
sr.Close()
End Sub
Private Sub SpeichernToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SpeichernToolStripMenuItem.Click
Dim sw As New StreamWriter("Datei.txt")
For Each line As String In RichTextBox1.Lines
sw.WriteLine(line)
Next
sw.Close()
End Sub
Private Sub ÜberToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ÜberToolStripMenuItem.Click
Form2.Show()
End Sub
End Class
Keine Kommentare:
Kommentar veröffentlichen