RichTextBox Control [resolved]
Hi all, i am struggling with the RichTextBox control on my form, i can bold letters but canot unbold them here is my code :
VB Code:
Private Sub LabelBold_Cick()
If RTBCode.SelBold = True then RTBCode.SelBold = Not True
If RTBCode.SelBold = False then RTBCode.SelBold = True
End Sub
Help please :)
EDIT: Nevermind, i know whats wring, even if the text gets set to unbold the next line sets it back to bold, wow, why didn't i notice that last night :S
I'm silly :)
The code should look like this :
VB Code:
Private Sub LabelBold_Click()
If RTBCode.SelBold = True Then RTBCode.SelBold = Not True Else RTBCode.SelBold = True
End Sub
Re: RichTextBox Control [resolved]
Try this:
VB Code:
Private Sub LabelBold_Cick()
If RTBCode.SelBold = True Then
RTBCode.SelBold = False
End if
If RTBCode.SelBold = False Then
RTBCode.SelBold = True
End If
End Sub
Or, you could just do this:
VB Code:
Private Sub LabelBold_Cick()
RTBCode.SelBold = Not RTBCode.SelBold
End Sub
Cheers,
RyanJ