RichTextBox help please 
Author Message
 RichTextBox help please

I want to build up text in a RTB, adding formatting to certain items
as I go, not all at once when I've finished adding text.  If I try
adding, say, bold (with RTB.SelBold), then add more text, the
formatting is lost.  Is it also possible to set the format for any
futher text added at the insertion point?  I can't seem to get this to
work either. I'm obviously not using this control correctly.  (VB5)


Sun, 19 Oct 2003 23:35:51 GMT  
 RichTextBox help please
I set integer pointers to where I want the formatting to change, and
do it after all the text has been added.



Quote:
>I want to build up text in a RTB, adding formatting to certain items
>as I go, not all at once when I've finished adding text.  If I try
>adding, say, bold (with RTB.SelBold), then add more text, the
>formatting is lost.  Is it also possible to set the format for any
>futher text added at the insertion point?  I can't seem to get this to
>work either. I'm obviously not using this control correctly.  (VB5)



Mon, 20 Oct 2003 15:29:11 GMT  
 RichTextBox help please
What you are probably doing is concatenating the text (as in
RichTextBox1.Text = RichTextBox1.Text & "some more text". This will produce
the problem that you are getting and it is also quite slow. A better way,
which is faster and will also solve your problem, is to use the SelText
method to insert new pieces of text. Try, for example:

With RichTextBox1
  .Text = ""
  .SelText = "This method "
  .SelBold = True
  .SelColor = vbBlue
  .SelText = "will work "
  .SelBold = False
  .SelColor = vbBlack
  .SelText = "without "
  .SelBold = True
  .SelText = "any "
  .SelBold = False
  .SelText = "problems."
End With


Quote:
> I want to build up text in a RTB, adding formatting to certain items
> as I go, not all at once when I've finished adding text.  If I try
> adding, say, bold (with RTB.SelBold), then add more text, the
> formatting is lost.  Is it also possible to set the format for any
> futher text added at the insertion point?  I can't seem to get this to
> work either. I'm obviously not using this control correctly.  (VB5)



Mon, 20 Oct 2003 17:47:16 GMT  
 RichTextBox help please
whatever you have "sel" or selected, is what gets the most recent formatting
command.

as you add text, you immediatly are dropped outside of your current selected
block of text, so subsequent additions get left as default formatted.

you must find a way to update the selected block AS you input or add text

i have gained a good respect for word procesor programs after dealing with
the minutae that is handled by them, as demonstrated by generating my own
RTF files!!!

--
best regards,
hapticz

<<<< +++++++++++++++++++++++++++++++++++++ >>>>

|I want to build up text in a RTB, adding formatting to certain items
|as I go, not all at once when I've finished adding text.  If I try
|adding, say, bold (with RTB.SelBold), then add more text, the
|formatting is lost.  Is it also possible to set the format for any
|futher text added at the insertion point?  I can't seem to get this to
|work either. I'm obviously not using this control correctly.  (VB5)



Mon, 20 Oct 2003 00:10:41 GMT  
 
 [ 4 post ] 

 Relevant Pages 

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

2. Can anyone HELP me PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE

3. RichTextBox LinkClicked event - PLEASE HELP ASAP!

4. RichTextBox Problem - PLEASE HELP

5. Please help: coloring RichTextBox

6. Help Me please Bug on RichTextBox ??

7. RichTextBox.SelPrint Bug??? Please Help

8. Please help me with Print Preview in RichTextBox

9. Please Help with RichTextBox

10. PLEASE HELP PLEASE HELP PLEASE HELP

11. RichTextBox Control Setting Fonts - HELP HELP HELP !!!!

12. Repost - RichTextBox and single quotes - please ...

 

 
Powered by phpBB® Forum Software