I have an image list control on a user control that I'm trying to access
from the main form. I've tried different code but can't get it. I get an
error: Cannot convert type 'System.Windows.Forms.Control' to
'System.Windows.Forms.ImageList'
ImageList il = new ImageList();
il = (ImageList)userControlMedia1.Controls.Find("imageListMedia", true);
Any ideas??
Tom John - 06 Jul 2007 16:22 GMT
Change the modifier of the imagelist control on the usercontrol to
Internal or Public and then use the following to access:
ImageList il = userControlMedia1.ImageListMedia;
Hope this helps
Tom
>I have an image list control on a user control that I'm trying to access
>from the main form. I've tried different code but can't get it. I get an
[quoted text clipped - 5 lines]
>
>Any ideas??