Question

i am using vb.net

i just wanna ask if we can place a picture in a picture box in different places...

for example, we place a picture in the center of a picture box then we place another picture on the left side of the picture box. is it possible??

and also can we use one picture box that can contain more pictures or images on it???

to make it clear, it is a drag and drop senario, first you have to drag a picture from a toolbar for example, then you are to drop it on the picutre box, the problem is, we have to drop more than one picture in the picturebox, so is it really possible?

Was it helpful?

Solution

To my knowledge, this is not possible with the standard .NET picturebox control.

You could, however, create a custom control that would encompass this functionality. I'm thinking it wouldn't be too complicated to do.

But probably the best way to handle it would be to create your picture box controls programmatically.

EDIT: Found something that might be useful for you, on CodeProject. Its a extended picturebox control, that seems to have multiple pictures in it.

Extended Picturebox

OTHER TIPS

You will need to build all this functionality from scratch no matter which control you're using. You can use Picturebox, Button, Panel and so on, and they'll all provide the same fundemental for building the required functionality. I would suggest that you used a panel/canvas though. And as Jon suggested, subclassing a panel to create a custom control would properably be the best idea.

Inside this custom control, you will need to keep track of which images that have been dragged into the control, which images is affected by several mouse actions such as click, hover and release, and you will need to draw the pictures manually.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top