Re: rich textbox loses formatting when printed to from 2 different subs
- From: "Ken Halter" <Ken_Halter@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 27 Apr 2006 10:56:49 -0700
"Mike Scirocco" <mscir@xxxxxxxxx> wrote in message
news:FoOdnTQmpvWxmczZRVn-gg@xxxxxxxxxxxxxxxxx
I'm using a rich textbox to let the user enter a few lines of text and
format them (font family, font size, italic, bold, color, underline).
Then I print a report to the rich textbox from a different sub on a
different form. When I do the textbox loses all of its formatting except
what was on the last line of the heading, and it applies that to the whole
textbox contents.
Is there a trick to this?
TIA
Mike
Post the code you're using to populate the box... you should be using
something like....
'==========
Public Sub AddSomeText(Text2Add As String, Optional AddCR As Boolean = True)
With RichTextBox1
'place the cursor at the end of all text
.SelStart = Len(.TextRTF)
'add the new text
.SelText = Text2Add
'optionally, add a cr/lf
If AddCR Then
.SelText = vbCrLf
End If
End With
End Sub
'==========
If you're using 'RichTextBox1.Text = RichTextBox1.Text & MoreText', you
won't be able to control formatting.
--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
.
- Follow-Ups:
- Re: rich textbox loses formatting when printed to from 2 different subs
- From: Rick Rothstein
- Re: rich textbox loses formatting when printed to from 2 different subs
- References:
- rich textbox loses formatting when printed to from 2 different subs
- From: Mike Scirocco
- rich textbox loses formatting when printed to from 2 different subs
- Prev by Date: Re: DLL Woes
- Next by Date: Re: rich textbox loses formatting when printed to from 2 different subs
- Previous by thread: rich textbox loses formatting when printed to from 2 different subs
- Next by thread: Re: rich textbox loses formatting when printed to from 2 different subs
- Index(es):
Relevant Pages
|