Im Using VB 2005 Express Edition
Im Making a Text Editor kinda like MS Word and Notepad Combined, So far i have Coded These Buttons:
New File
Open
Save
Save As
Close
Undo
Cut
Copy
Paste
Select All
View Textboxes
View Labels
View Images
View ToolBars (Basic & Advanced).
Anywho i want to add Bold, Italic And Underline to Both the Edit menu, and the Basic Toolbar, But that doesnt really matter, I just need help with the code for the button.
At the Moment i Have:
Expand|Select|Wrap|Line Numbers
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- If RichTextBox1.Font.Style <> FontStyle.Bold Then
- RichTextBox1.Font = New Font(RichTextBox1.Font, FontStyle.Bold)
- Else
- RichTextBox1.Font = New Font(RichTextBox1.Font, FontStyle.Regular)
- End If
- End Sub
Soo My Question Is!
Is there a way of making the code i already have apply to selected text INSTEAD of the whole RTB?
Thanks,
Prose!