Hello,
I have a Picture box which has labels and images and shapes inside it, and i want to copy this picture box with every thing in it to another form in my app, how the hell i do this???
Please Help
Printable View
Hello,
I have a Picture box which has labels and images and shapes inside it, and i want to copy this picture box with every thing in it to another form in my app, how the hell i do this???
Please Help
as long as everything else (the labels etc) are physically inside the picturebox, so that when you drag the picture box, all its contents move with it - then :
just click on the picturebox itself (with left mouse button) and then EDIT > COPY from menu
just click on the picturebox itself (with right mouse button) and then COPY from popupmenu
to paste
click on new form and EDIT > PASTE
DocZaf
{;->
There are several ways to accomplish this. Anything you draw on a picture box becomes a part of its image. If you want to then transfer this image to another control you can:
Set the picture property of the new obect to match the image property of the old
Use the paintpicture commandCode:Form2.picture=Picture1.Image
Code:Picture1.Picture=Picture1.Image
Form2.paintpicture Picture1.Picture,0,0
Sorry, my misunderstanding
ok thanx, but this wasn't what i need, what i need is to make a copy of the picture box and it's contents and put it in another form DURING THE RUN TIME, Please help
Well my misunderstanding wasn't one after all.
Say you have a picture box called Picture1 on Form1, and a picture box on Form2 called Picture1 as well. You would draw your shapes onto the first picture box, then to copy them to the second during run-time you would use this code in a command button or something:
Code:Form2.Picture1.Picture=Form1.Picture1.Image
May be you can use the Clipboard Object?
Code:'Copy Image from PictureBox Control into Clipboard
Clipboard.SetData Picture1.Picture
'Retrieve the Image from Clipboard into a new PictureBox Control
Picture2.Picture = Clipboard.GetData()
ok ok ok ok
WE HAVE A BIG BIG MISUNDERSTANDING IN HERE, i know every thing you said, this will work if i want to copy the picture from one picbox to another, but my question is:
[b]I have a picture box which has controls in it, like label inside the picture box and imagebox inside the picture box and anpther small picture boxes inside the big picture box, and i want to make a copy of these stuff "the big picture box and the other controls inside it" to another form, GOT IT OR NOT, Please help..
Hello guys
PLEASE HELP ME, I REALLY NEED THIS
It's an unusual problem. Could you not just create a new instance of the picture box?
What do you mean???
Make the picturebox an array, use load statement to load a new instance of it and then use setparent api to put it in the other form
Thanx Kedaman, i will try to figure it out