|
-
Apr 23rd, 2005, 12:44 PM
#1
Thread Starter
Addicted Member
RichTextBox.SelPrint - Whole Doc
Whenever I try to Use .SelPrint with a rich text box, it prints only the first page, both when none, or all of the contents are selected. The description of the function says that it's printing the contents of the control on any DC, but all the info I got online seems to point towards real printing only. I'm drawing to a picturebox(planning to switch to a MemDC though), and have spent an hour trying to debug the problem with no results. Is there some workaround, or am I doing something wrong? the basic code I'm using is:
VB Code:
'prac_picBook: Target picturebox.
'prac_picBuffer: The picturebox I'm printing to.
'prac_rtb: The Rich Text Box control.
'The Blitting calls don't have much to do with the actual problem, so you can ignore it.
'All picBoxes are AutoRedrawed.
prac_picBook.Cls
prac_picBuffer.Cls
prac_rtb.SelStart = 0
prac_rtb.SelLength = 0 'or [Len(prac_rtb.Text)]
prac_rtb.SelPrint (prac_picBuffer.hdc)
Call BitBlt(prac_picBook.hdc, 44, 20, prac_picBook.ScaleWidth, _
prac_rtb.SelFontSize * RTF_POINTS_PER_PIXEL * 16, prac_picBuffer.hdc, _
0, (Page - 1) * prac_rtb.SelFontSize * RTF_POINTS_PER_PIXEL * 16, _
vbSrcCopy)
Call BitBlt(prac_picBook.hdc, 268, 20, prac_picBook.ScaleWidth, _
prac_rtb.SelFontSize * RTF_POINTS_PER_PIXEL * 16, prac_picBuffer.hdc, _
0, Page * prac_rtb.SelFontSize * RTF_POINTS_PER_PIXEL * 16, vbSrcCopy)
prac_picBook.Refresh
-
Sep 20th, 2013, 10:59 AM
#2
New Member
Re: RichTextBox.SelPrint - Whole Doc
Hi,
I have the same problem. Do you find some solution? If so, could you please share it?
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
|