Brendan,
Quote:
>I have a Picturebox control and an Image control in the Picturebox. Is there
>a way to find out what container a control is in. Ex.(In a form or in a
>picturebox)
Sure, use the Container property and the TypeOf .. Is operator.
If TypeOf Image1.Container Is PictureBox Then
MsgBox "It's in a PictureBox"
ElseIf TypeOf Image1.Container Is Form Then
MsgBox "It's on a Form"
Else
MsgBox "It's in a " & TypeName(Image1.Container)
End If
Mattias
===
Mattias Sj?gren (VB MVP)
http://www.msjogren.net/dotnet/