Control Container 
Author Message
 Control Container

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)


Fri, 19 Nov 2004 04:09:04 GMT  
 Control Container
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/



Fri, 19 Nov 2004 06:58:40 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Custom Control: Container inside container...

2. Custom Control: Container inside container...

3. How to set a controls container to a control on a UserControl

4. ActiveX Control Container for VBCCE5 ActiveX Controls!?

5. Detecting developer dropping controls into ActiveX control container - VB5 Events

6. ActiveX Control Container -- Notification when child controls are created

7. Usercontrol as a control container

8. Help with transparent control-containers...

9. Printing from OLE Control Container

10. Tree-like control container

11. control container value question

12. Scrollable Control Containers - Recommendations please?

 

 
Powered by phpBB® Forum Software