×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Printing on a VB6 Picturebox

Printing on a VB6 Picturebox

Printing on a VB6 Picturebox

(OP)
How can text be printed on a VB6 Picturebox control Labels don't seem to be permitted.

RE: Printing on a VB6 Picturebox

Picturebox has a Print method (and CurrentX and CurrentY properties to set the point at which printing will occur)

RE: Printing on a VB6 Picturebox

What do you mean by "text be printed on a VB6 Picturebox control"?
PictureBox control is usually used to show a picture / image.

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson

RE: Printing on a VB6 Picturebox

>used to show a picture

Such a sheltered life you lead, Andy wink . There is so muchg more you can do with a picturebox - it is a graphical canvas you can paint on to your heart's delight. Animate an image, add captions and annotations, stream video on it (with a bit of work), apply filters, composite images. etc, etc ...

If you just want to show a picture ... use the much more limited Image control

RE: Printing on a VB6 Picturebox

I use 2 labels on a picture box to add a caption to a photograph. Set a transparent background and offset the x and y of one label and set the foreground colour of the rearmost label to black. This gives the appearance of a shadow.

Experience is something you don't get until just after you need it.

RE: Printing on a VB6 Picturebox

But you can achieve exactly the same effect printing directly to the picturebox. No need for extra controls. Guess it comes down to personal preference.

here's an example

CODE -->

    With Picture1
        .AutoRedraw = True
    
        .ScaleMode = vbPixels
        .FontName = "Arial"
        .FontSize = 18
        .FontBold = True
        
        .CurrentX = 15
        .CurrentY = 15
        .ForeColor = vbBlack
        Picture1.Print "Just an example"
        
        .CurrentX = 13
        .CurrentY = 13
        .ForeColor = vbWhite
        Picture1.Print "Just an example"
        .AutoRedraw = False
    End With 


RE: Printing on a VB6 Picturebox

(OP)
Thank you, especially for the example. That has solved my problem.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close