How To Make An Advanced Notepad In Visual Basic 2008

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
59,780
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Apr 15, 2009

Visual Basic 2008 - Advanced Notepad. I Just remade my video on How to make a text editor in visual basic 2008 and made it it better and easier to understand. This is a tutorial on a simple Notepad which has; New, Open, Save, Font, Colour, Undo, Redo, Cut, Copy, Paste, Clear, Select All. Enjoy and here are the codes:

New:
RichTextBox1.Clear()

Open:
Try
Dim dlg As OpenFileDialog = New OpenFileDialog
dlg.Title = "Open"
dlg.Filter = "Rich Text Files (*.rtf)|*.rtf"
If dlg.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
RichTextBox1.LoadFile(dlg.FileName)
End If
Catch ex As Exception : End Try

Save:
Try
Dim dlg As SaveFileDialog = New SaveFileDialog
dlg.Title = "Save"
dlg.Filter = "Rich Text Files (*.rtf)|*.rtf"
If dlg.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
RichTextBox1.SaveFile(dlg.FileName, RichTextBoxStreamType.RichText)
End If
Catch ex As Exception : End Try

Undo:
RichTextBox1.Undo()

Redo:
RichTextBox1.Redo()

Cut:
RichTextBox1.Cut()

Copy:
RichTextBox1.Copy()

Paste:
RichTextBox1.Paste()

Clear:
RichTextBox1.Clear()

Select All:
RichTextBox1.SelectAll()

Colour:
Try
Dim dlg As FontDialog = New FontDialog
dlg.Font = RichTextBox1.Font
If dlg.ShowDialog = System.Windows.Forms.DialogResult.OK Then
RichTextBox1.Font = dlg.Font
End If
Catch ex As Exception : End Try

Font:
Try
Dim dlg As ColorDialog = New ColorDialog
dlg.Color = RichTextBox1.ForeColor
If dlg.ShowDialog = System.Windows.Forms.DialogResult.OK Then
RichTextBox1.ForeColor = dlg.Color
End If
Catch ex As Exception : End Try

  • likes, 19 dislikes

Link to this comment:

Share to:
see all

All Comments (468)

Sign In or Sign Up now to post a comment!
  • @jibz988 Then go back to main form and double-click the 'close' item under the 'file' menu bar and encode Form2.show() . That's just it.

  • @jibz988 First create a second form with two buttons named 'yes' and 'no' and a label that says, "Do you want to exit the program without saving it?'. Then, encode the ff:

    'yes' button:

    End

    'no' button:

    Dim SaveFileDialog1 As New SaveFileDialog

    Dim RichTextBox1 As New RichTextBox

    SaveFileDialog1.Filter = "rtf files(*.rtf)|*.rtf|txt files(*.txt)|*.txt|All files(*.*)|*.*"

    If SaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then

    RichTextBox1.SaveFile(SaveFile­Dialog1.FileName)

    End If

  • @keeblerelmcookies Code for print:

    Dim PrintDialog1 As New PrintDialog

    PrintDialog1.ShowDialog()

  • no find, replace???

  • Print????????

  • close???

    

  • @super1992ism Really?I can save, Try Click Save,and name 123,Save at desktop,and open?

  • I make it better...

  • Font and Color dialog's are backwards ;)

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more