Please help: coloring RichTextBox 
Author Message
 Please help: coloring RichTextBox

Hi all,

I'm using a RichTextBox (SP2) in VB 5.0 (SP3) and I have a problem
with the following code:

 With rtf
   .SelStart = Len(.Text)
   .SelColor = vbBlue
   .Text = .Text & "Blue" & vbCrLf
   .SelStart = Len(.Text)
   .SelColor = vbRed
   .Text = .Text & "Red" & vbCrLf
   .SelStart = Len(.Text)
   .SelColor = vbGreen
   .Text = .Text & "Green" & vbCrLf
   .SelStart = Len(.Text)
   .SelColor = vbMagenta
   .Text = .Text & "Magenta" & vbCrLf
 End With

When this code is executed all text is blue instead of having all the
words in their own color...

Anyone know how to solve this ?

Thanks,
Ruben



Sun, 15 Apr 2001 03:00:00 GMT  
 Please help: coloring RichTextBox
The Text property on the rtf control is for all of the text. You need to use
.SelText instead.

ex.

with rtf
    .selcolor = vbBlue
    .seltext = "Blue" & vbcrlf
    .selcolor = vbRed
    .seltext = "Red" & vbcrlf
    ...
end with

Quote:

>Hi all,

>I'm using a RichTextBox (SP2) in VB 5.0 (SP3) and I have a problem
>with the following code:

> With rtf
>   .SelStart = Len(.Text)
>   .SelColor = vbBlue
>   .Text = .Text & "Blue" & vbCrLf
>   .SelStart = Len(.Text)
>   .SelColor = vbRed
>   .Text = .Text & "Red" & vbCrLf
>   .SelStart = Len(.Text)
>   .SelColor = vbGreen
>   .Text = .Text & "Green" & vbCrLf
>   .SelStart = Len(.Text)
>   .SelColor = vbMagenta
>   .Text = .Text & "Magenta" & vbCrLf
> End With

>When this code is executed all text is blue instead of having all the
>words in their own color...

>Anyone know how to solve this ?

>Thanks,
>Ruben



Tue, 17 Apr 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

2. Color in Richtextbox, Pro Help plzz

3. Help with RichTextBox and Colors

4. Help: color coding, RichTextBox

5. Can anyone HELP me PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE

6. RichTextBox LinkClicked event - PLEASE HELP ASAP!

7. RichTextBox help please

8. RichTextBox Problem - PLEASE HELP

9. Help Me please Bug on RichTextBox ??

10. RichTextBox.SelPrint Bug??? Please Help

11. Please help me with Print Preview in RichTextBox

12. Please Help with RichTextBox

 

 
Powered by phpBB® Forum Software