Results 1 to 2 of 2

Thread: RichTextBox.SelPrint - Whole Doc

  1. #1

    Thread Starter
    Addicted Member Max_aka_NOBODY's Avatar
    Join Date
    Jul 2004
    Location
    Amman, Jordan
    Posts
    179

    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:
    1. 'prac_picBook: Target picturebox.
    2. 'prac_picBuffer: The picturebox I'm printing to.
    3. 'prac_rtb: The Rich Text Box control.
    4. 'The Blitting calls don't have much to do with the actual problem, so you can ignore it.
    5. 'All picBoxes are AutoRedrawed.
    6. prac_picBook.Cls
    7. prac_picBuffer.Cls
    8. prac_rtb.SelStart = 0
    9. prac_rtb.SelLength = 0 'or [Len(prac_rtb.Text)]
    10. prac_rtb.SelPrint (prac_picBuffer.hdc)
    11.  
    12. Call BitBlt(prac_picBook.hdc, 44, 20, prac_picBook.ScaleWidth, _
    13. prac_rtb.SelFontSize * RTF_POINTS_PER_PIXEL * 16, prac_picBuffer.hdc, _
    14. 0, (Page - 1) * prac_rtb.SelFontSize * RTF_POINTS_PER_PIXEL * 16, _
    15. vbSrcCopy)
    16.  
    17. Call BitBlt(prac_picBook.hdc, 268, 20, prac_picBook.ScaleWidth, _
    18. prac_rtb.SelFontSize * RTF_POINTS_PER_PIXEL * 16, prac_picBuffer.hdc, _
    19. 0, Page * prac_rtb.SelFontSize * RTF_POINTS_PER_PIXEL * 16, vbSrcCopy)
    20.  
    21. prac_picBook.Refresh

  2. #2
    New Member
    Join Date
    Sep 2013
    Posts
    8

    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
  •  



Click Here to Expand Forum to Full Width