tags:

views:

117

answers:

1

Hi! I have CheckedListBox, now i want to put image from the ImageList next to the every checkbox.

I try to do that with this:

CheckedListBox1.Items.Add(ImageList1.Images(0))

But with this I get only checkbox with text System.Drawing.Bitmap!

What I am doing wrong, I and how i can put image next to the checkbox?

Thanks!

A: 

CheckedListBox1.Items is a String list. if you call ToString (that does the checkbox) on a bitmap it will print System.Drawing.Bitmap.

You can create your own control that acts like a CheckListBox. Then create a function Add that will take an image and a string, store that in an vector. As last implement the OnPaint to draw your own checkedlistbox with the images in the vector.

Something like this codeproject link

PoweRoy