0

Okay, i have 2 objects in my form: a label with a picture and a picturebox with a picture.
The background of my form has another picture.
What i want to happen:
1.I press the label,the picture of the label is on top with the bakground of the picture in my picturebox.
2.when i release the label i want the label to still have its picture on top but now i want the label background to be the form's bacground picture;
My Code

//Label color is transparent
//picturebox picture through label
label1.parent = pictureBox1;
//the label's picture is on top with the picturebox's picture as its background
//Now i have a problem
//normally i would do
label1.parent = Form1;
//however it gives me an error "'Chess.Form1' is a 'type' but is used like a 'variable'"

does anyone know how to set the label1's Parent property to Form1?
i know its possible because the default Label1 parent is Form1
i know this for a fact when i did

MessageBox.show(Label1.Parent.ToString());

and i got "WindowsFormsApplication1.Form1, Text:Form1"

Any help is appreciated ;)

Edited by toko: n/a

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by toko
0

wow so simple :'(:'(:'(:'(:'(
yet i never thought of it, even though i used it a billion times before.

Thank you

Edited by toko: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.