Results 1 to 6 of 6

Thread: printing controls in picturebox

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2000
    Location
    Suffolk. UK
    Posts
    162
    I have created a picturebox with Rich Text Boxes strategically placed within it. I can print the bmp of the picture but the controls do not print using:

    Printer.PaintPicture Picture2.Image....

    I have fiddled with autoredraw but can't seem to solve it. Any clues please?


  2. #2
    Lively Member
    Join Date
    Mar 2000
    Posts
    82
    I have an idea, but it is ugly. I'll wait to see if anybody has an easy solution to this. email me if you don't get an answer: [email protected]

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2000
    Location
    Suffolk. UK
    Posts
    162
    How ugly's UGLY


    ping

  4. #4
    Lively Member
    Join Date
    Mar 2000
    Posts
    82
    OK... add another form to your project, set the borderstyle to 0-none, and add a RTB to it.
    then in your main form behind a button add:


    [code]
    Private Sub Command1_Click()
    PrintPicBox Picture1.Picture, Picture1.Height, Picture1.Width, rtb.Left, rtb.Width, rtb.Top, rtb.Height
    End Sub

    Public Sub PrintPicBox(pic As Object, H As Long, W As Long, rtbLeft As Long, rtbWidth As Long, _
    rtbTop As Long, rtbHeight As Long)
    Form2.Width = W
    Form2.Height = H
    Form2.Picture = pic
    Form2.rtb.Move rtbLeft, rtbTop, rtbWidth, rtbHeight
    Form2.PrintForm
    Printer.EndDoc
    Unload Form2
    End Sub
    [code]


    I didn't have time to set this up for multiple RTB's but i'm sure you can use some arrays or udt's. sorry this is so short, but i gotta go to work about 10 min's ago. there has to be an easier way to do this , but i hope this helps for now. good luck

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Mar 2000
    Location
    Suffolk. UK
    Posts
    162
    I just got home.....

    Thanks for the code, I'll keep you in touch.

    Thanks very much,

    Ping

  6. #6
    Addicted Member
    Join Date
    May 2000
    Location
    Grand Rapids, MI
    Posts
    231
    I fail to see how moving the RichTextBox to the exact same position it was already in helps? I also fail to see why use a RTB when you assign the picture to the Form?
    -Karl Blessing aka kb244{fastHACK}
    [email protected]

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