OwnerDrawItem event example for Visual Basic
Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
Private Declare Function Ellipse Lib "gdi32" (ByVal hDC As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Sub LEADRasImgList1_OwnerDrawItem(ByVal nIndex As Long, ByVal hDC As Long, ByVal ItemLeft As Single, ByVal ItemTop As Single, ByVal ItemRight As Single, ByVal ItemBottom As Single, ByVal ItemBackLeft As Single, ByVal ItemBackTop As Single, ByVal ItemBackRight As Single, ByVal ItemBackBottom As Single)
'use Windows GDI to custom paint the items
'make sure you have previously set ScaleMode to Pixels (3) so
'that you get these values in Pixels rather than Twips!!!!!!!
'ex. LEADRasImgList1.ScaleMode = 3 'pixels
Dim szText As String
szText = LEADRasImgList1.Item(nIndex).Text
Ellipse hDC, ItemLeft, ItemTop, ItemRight, ItemBottom
TextOut hDC, ItemLeft, ItemTop, szText, Len(szText)
End Sub