views:

242

answers:

2

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?

A: 

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

Jon
if we cannot use picture box about that senario can you suggest any that we can use to achieve the goal of putting multiple pictures?
krizz
As mentioned, you would need to create a custom control. It would require a little bit of work to get the desired functionality. It kinda sounds like you are looking for a existing control that will do this. You will not find a control like that unless someone else has already created something similar, and posted the code online.
Jon
A: 

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.

Qua