Hi!
I am trying to make like a NotePad program. I'm now working with how to change fonts and weight, but the weight part isn't succesful. How can i make the text I have marked bold?
/ Erik
Printable View
Hi!
I am trying to make like a NotePad program. I'm now working with how to change fonts and weight, but the weight part isn't succesful. How can i make the text I have marked bold?
/ Erik
Don't use a regular textbox. Use a RichTextBox.
And here is the code to make the selected text bold:
Code:Private Sub Command1_Click()
If RichTextBox1.SelText <> "" Then
If RichTextBox1.SelBold = False Then
RichTextBox1.SelBold = True
Else
RichTextBox1.SelBold = False
End If
End If
End Sub
Hi again!
Thanks for the help, but how do I create a RichTextBox?
/ Erik
Click on Project > Components... and make sure Microsoft Rich TextBox Control 6.0 (or whatever version you have) is checked.
Matthew: You can accomplish what you did much easier using the Not logic operator.
Code:RichTextBox1.SelBold = Not RichTextBox1.SelBold