Custom Control Creation Question

trisight
06-08-2005, 08:12 PM
I am creating a custom control that involves adding images to the control. I would like to allow the programmer to link an imagelist to the control. I did the code as follows:


Private mimgImageList As ImageList

Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
Set PictureList = PropBag.ReadProperty("ImageList", Nothing)
End Sub

Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("ImageList", ImageList, Nothing)
End Sub

Public Property Get ImageList() As ImageList
Set ImageList = mimgImageList
End Property

Public Property Set ImageList(ByVal imgNewImageList As ImageList)
Set mimgImageList = imgNewImageList
PropertyChanged "ImageList"
End Property


The problem that I have is that when I place the custom control onto a form I do not see the ImageList property. The property is there because I can set it in the code, but I would like to make it visible in the property browser. Can anyone help me out? Also, I'm new to custom control creation, should I make the Set ImageList ByRef instead of ByVal?

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum