Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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()
- Cut: RichTextBox1.Cut()
- Copy: RichTextBox1.Copy()
- Paste: RichTextBox1.Paste()
- Select All: RichTextBox1.SelectAll()
- =============================
- Text 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
- ==============================
- Back Color:
- Try
- Dim dlg As ColorDialog = New ColorDialog
- dlg.Color = RichTextBox1.BackColor
- If dlg.ShowDialog = System.Windows.Forms.DialogResult.OK Then
- RichTextBox1.BackColor = dlg.Color
- End If
- Catch ex As Exception
- End Try
- ========================
- 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
- =============================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement