问题描述
我的CheckedListBox,现在我希望把图像从ImageList中旁边的每一个复选框。
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))
不过,有了这个,我只得到复选框的文字System.Drawing.Bitmap!
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?
谢谢!
推荐答案
CheckedListBox1.Items是一个字符串列表。如果你调用toString(即不复选框),上一个位图,它会打印System.Drawing.Bitmap。
CheckedListBox1.Items is a String list. if you call ToString (that does the checkbox) on a bitmap it will print System.Drawing.Bitmap.
您可以创建自己的控件,就像一个的CheckListBox。然后创建一个函数添加将拍摄图像和一个字符串,存储在一个载体。截至去年实施的OnPaint绘制自己的CheckedListBox与矢量图像。
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.
像这样 $ C $的CProject链接
这篇关于旁边的CheckedListBox复选框图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!