CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Mar 2009
    Posts
    17

    mdi text editor printing color text

    hi all im trying to addapt my printing code so it will print my text what ever i have selected it to be in the text editor. here is the code i have at the moment can someone help me please.

    Private Sub PrintDocument1_BeginPrint(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintEventArgs) Handles mypdoc.BeginPrint
    str = CType(Me.ActiveMdiChild, frmSplit).RTB.Text 'If this was a single text editor this line would read (str = mytext.text)
    f = CType(Me.ActiveMdiChild, frmSplit).Font
    b = New SolidBrush(Me.ActiveMdiChild.ForeColor)
    strformat = New StringFormat()
    strformat.Trimming = StringTrimming.Word
    End Sub

  2. #2
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: mdi text editor printing color text

    Help with what. Could you explain what exactly you are trying to do. There is no question mentioned in your post.

    Also please use code tags when you are posting code here in forums.

  3. #3
    Join Date
    Mar 2009
    Posts
    17

    Re: mdi text editor printing color text

    i have a mdi text editor with as many child forms as i like. i have a function that i can change the colour and font of my text in any child form i want.

    this is my problem.

    when i goto print preview the text is black and normal size and not what i changed it to in the child form.

    the code in the above post i made is not working correctly and i need help in making it right.

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: mdi text editor printing color text

    That is in BEGIN PRINT, not PREVIEW, which is why you don't see it.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Mar 2009
    Posts
    17

    Re: mdi text editor printing color text

    Quote Originally Posted by dglienna View Post
    That is in BEGIN PRINT, not PREVIEW, which is why you don't see it.
    surly i would not have the same code in printpreview as i would in beginprint?

  6. #6
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: mdi text editor printing color text

    Just use the same class on two devices
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  7. #7
    Join Date
    Mar 2009
    Posts
    17

    Re: mdi text editor printing color text

    Quote Originally Posted by dglienna View Post
    Just use the same class on two devices
    sorry im new to all of this!!

    please take alook at my editor and you will see what i mean
    Attached Files Attached Files

  8. #8
    Join Date
    Mar 2009
    Posts
    17

    Re: mdi text editor printing color text

    just wondering how anyone is getting on with my issue. ive noticed that 8 people have downloaded my on going project, i really hope someone can help

  9. #9
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: mdi text editor printing color text

    Could have searched at least a little...

    http://msdn.microsoft.com/en-us/library/ms996492.aspx
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

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

Featured