You have to cast the value as Form. Forms inherit from the Control class,
and the Parent property is type Control, but can be a Form.
You Might also have a nested control (control inside a control).
In that case try PicBox.TopLevelControl instead of PicBox.Parent
-Rob Teixeira [MVP]
"gael" <an*******@discussions.microsoft.com> wrote in message
news:13*****************************@phx.gbl...
object parentForm = PicBox.Parent; ----->doesnt work
when i try to do this, the type of parentForm is
System.Windows.Forms.Control but i want it to be
System.Windows.Forms.Form.
I just want a funtion that return the form in which there
is my pictureBox.