printing reach text box control content

  • 17 years ago

    Hi,
    how do I print page by page the content of a reach text box? the page option of the printer window is disable
    thanks

  • 17 years ago

    if ure code looks something like below


    Code:

    On Error GoTo printerror


      ' The CommonDialog control is named "dlgPrint."
       
      Form1.dlgprint.Flags = cdlPDReturnDC + cdlPDNoPageNums
      If Form1.RichTextBox1.SelLength = 0 Then
         Form1.dlgprint.Flags = Form1.dlgprint.Flags + cdlPDAllPages
      Else
         Form1.dlgprint.Flags = Form1.dlgprint.Flags + cdlPDSelection
      End If
      Form1.dlgprint.ShowPrinter
      Form1.RichTextBox1.SelPrint Form1.dlgprint.hDC
    Exit Sub
    printerror:
    MsgBox "Print Error!"



    u will notice the + cdlPDNoPageNums is added, this disables the page selection part. Dont include this then u can select the pages, more info here


    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cmdlg98/html/vbproFlagsPrint.asp

  • 17 years ago

    my code looks the same, but the page option is still disabled;
    I think isn't important what type of printer I use...

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Computer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter” - Eric Raymond