Results 1 to 3 of 3

Thread: How to print a RTF?

  1. #1

    Thread Starter
    Addicted Member pourkascheff's Avatar
    Join Date
    Apr 2020
    Location
    LocalHost
    Posts
    147

    How to print a RTF?

    Hi all,
    Consider you have a RichTextBox1 control filled with lots of texts.

    There are 3 controls which I am sure I have to use them:
    1) PrintDocument1 which is a hidden control and this is the thing you finally print. But I have no idea how can I import my RTF texts in it.
    2) PrintPreviewControl1 which is visible and gets that "PrintDocument1" as input document to preview. Very handy control.
    3) At last PrintDialog1 which provides available printers and their advanced settings like before, then finally lead to printing [possibly] that "PrintDocument1".

    How can I make this sequence possible?
    𝕬𝖒𝖎𝖗 𝕽. 𝕻𝖔𝖚𝖗𝖐𝖆𝖘𝖈𝖍𝖊𝖋𝖋

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    109,266

    Re: How to print a RTF?

    For the record, a PrintDocument is not a control. It is a component. All controls inherit the Control class, which PrintDocument does not. Control inherits Component and being a component is all that's required to be added to the Toolbox.

  3. #3
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    109,266

    Re: How to print a RTF?

    Check this out:

    https://stackoverflow.com/questions/...ng-richtextbox

    That is in C# but you can use Instant VB from Tangible Software Solutions to convert it. There's also this in VB:

    https://social.msdn.microsoft.com/Fo...orum=vbgeneral

    If you want to look further, the keywords are "wysiwyg richtextbox" and make sure you keep it to WinForms.

Tags for this Thread

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