Link to home
Start Free TrialLog in
Avatar of RobK6364
RobK6364

asked on

exposing an imagelist property in my custom control

hello experts... i'm trying to expose a propery to attach an imagelist to my custom control... but i dont see the property... and i was thinking maybe somehow i have to do the "custom" property like a listview control uses to attach the imagelist.  can someone explain how i can attach an imagelist to my control?

or better yet, if you can tell me how i can create an instance of an imagelist without having to include comctl32.ocx in my custom control project.  comctl32 will be included in the project that i plan to use the custom control in...

i'm trying this to expose the imagelist property...
'=======================================
dim m_ImageList as object
Public Property Get ImageList() As Object
   ImageList = m_ImageList
End Property
Public Property Let ImageList(ByVal NewImageList As Object)
   Set m_ImageList = NewImageList
End Property
Public Property Set ImageList(ByVal NewImageList As Object)
   Set m_ImageList = NewImageList
End Property
'=======================================
ASKER CERTIFIED SOLUTION
Avatar of Dana Seaman
Dana Seaman
Flag of Brazil image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
By the way...If you want to create the Imagelist in your control there is code at VbAccelerator to do this. The dependency is ComCtl32.Dll which is present in all Windows OS and does not need to be included in your deployment package. There is a great example on how to implement this at PSC. You initialise the ImageList using "InitializeImageListSmall" and supply a bitmap strip using "ImageListSmall_AddBitmap". Link http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=56021&lngWId=1. Also see VbAccelerator.com for lighweight ImageList classes.
Avatar of RobK6364
RobK6364

ASKER

thanks, got it workin : )