Personal site - Advanced NotePad Coding
Paqotote
Site menu
Our poll
Rate my site
Total of answers: 63

Public Class Form1

Private Sub NewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewToolStripMenuItem.Click

RichTextBox1.Text = ""

End Sub

Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click

End

End Sub

Private Sub CutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CutToolStripMenuItem.Click

RichTextBox1.Cut()

End Sub

Private Sub CopyToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CopyToolStripMenuItem.Click

RichTextBox1.Copy()

End Sub

Private Sub PasteToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PasteToolStripMenuItem.Click

RichTextBox1.Paste()

End Sub

Private Sub SelectToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SelectToolStripMenuItem.Click

RichTextBox1.SelectAll()

End Sub

Private Sub ClearAllToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClearAllToolStripMenuItem.Click

RichTextBox1.Text = ""

End Sub

Private Sub UndoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UndoToolStripMenuItem.Click

RichTextBox1.Undo()

End Sub

Private Sub RedoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RedoToolStripMenuItem.Click

RichTextBox1.Redo()

End Sub

Private Sub FontToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FontToolStripMenuItem.Click

Dim FS As New FontDialog

Try

FS.ShowDialog()

RichTextBox1.Font = FS.Font

Catch ex As Exception

'Do nothing on exeption

End Try

End Sub

Private Sub ColorToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ColorToolStripMenuItem.Click

Dim FC As New ColorDialog

Try

FC.ShowDialog()

RichTextBox1.ForeColor = FC.Color

Catch ex As Exception

'Again, do nothing on exception

End Try

End Sub

Private Sub PrintToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintToolStripMenuItem.Click

Dim AB As New PrintDialog

Try

AB.ShowDialog()

RichTextBox1.Text = AB.PrintToFile

Catch ex As Exception

'Again, do nothing on exception

End Try

End Sub

Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click

Dim Alltext As String = "", LineOftext As String = ""

OpenFileDialog1.Filter = "(*.txt)|*.txt|All files (*.*)|*.*"

OpenFileDialog1.ShowDialog()

If OpenFileDialog1.FileName <> "" Then

Try

FileOpen(1, OpenFileDialog1.FileName, OpenMode.Input)

Do Until EOF(1)

LineOftext = LineInput(1)

Alltext = Alltext & LineOftext & vbCrLf

Loop

RichTextBox1.Text = Alltext

Catch

Finally

FileClose(1)

End Try

End If

End Sub

Private Sub SaveToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripMenuItem.Click

SaveFileDialog1.Filter = "txt (*.txt|*.txt"

SaveFileDialog1.ShowDialog()

If SaveFileDialog1.FileName <> "" Then

FileOpen(1, SaveFileDialog1.FileName, OpenMode.Output)

PrintLine(1, RichTextBox1.Text)

FileClose(1)

End If

End Sub

End Class

Login form
E-mail:
Password:
News calendar
«  November 2009  »
SuMoTuWeThFrSa
1234567
891011121314
15161718192021
22232425262728
2930
Search
Site friends
Statistics

Total online: 1
Guests: 1
Users: 0
Copyright MyCorp © 2009Site managed by uCoz system