|
-
May 26th, 2005, 05:55 AM
#1
Thread Starter
Frenzied Member
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
-
May 26th, 2005, 05:56 AM
#2
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
-
May 26th, 2005, 05:58 AM
#3
Hyperactive Member
Re: RichTextBox Control
your code is a little confusing to read. Try this 
VB Code:
Public Sub Temp()
RTBCode.SelBold = Not RTBCode.SelBold 'This implements a toggle!
End Sub
---
Clearly I am a slow typer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|