Solved

display several images in a picturebox

Posted on 2003-10-31
4
125 Views
Last Modified: 2013-12-25
Hallo,

I need help on the way to display several images in a picturebox control.

Thanks for helping


James
0
Comment
Question by:dabayi
  • 2
4 Comments
 
LVL 85

Expert Comment

by:Mike Tomlinson
Comment Utility
You would have to get a device context for your picturebox control and then manually BitBlt images onto different areas of the picturebox.

This is advanced API programming and would most likely require more points to get the attention of the experts.
0
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 20 total points
Comment Utility
Actually, there is a way to do it using VB alone.  This will put the two pictures side by side in the PictureBox:

Private Sub Command1_Click()
    Dim p1 As Picture
    Dim p2 As Picture
   
    Set p1 = LoadPicture("c:\my documents\my pictures\decorative_horse.gif")
    Set p2 = LoadPicture("c:\my documents\my pictures\decorative_horse2.bmp")

    Picture1.AutoRedraw = True
    Picture1.ScaleMode = vbPixels
    Picture1.PaintPicture p1, 0, 0
    Picture1.PaintPicture p2, Picture1.ScaleX(p1.Width, vbHimetric, vbPixels), 0
End Sub

Idle_Mind
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now