How To Make A Basic Text Editor In Microsoft Visual Basic 2010 Express

Опубликовано: 17 Май 2026
на канале: Spawnlnc
11,090
36

This is a short tutorial on how to make a basic text editor via Microsoft visual basic 2010
here is the codes for each one leave a comment for help

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()

Select All:
RichTextBox1.SelectAll()


Font:
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




color:
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