2012-03-27 72 views
0

我有一些麻烦添加项目(字符串图像)ImageListBoxControl。 图片我从资源获取; 我已经添加了图像的ImageList,但我不知道如何将它添加到ImageListBoxControl,因为它需要imageIndex指定的,但我不知道如何得到它; 有人能帮助我吗?C#项目添加到ImageListBoxControl

回答

0

该指数是其中的产品(从0开始),所以我们说,如果它在列表中的第3项的位置,该指数是2(指数是一个int顺便说一句,而不是字符串)。

将其添加到您的ImageListBoxControl你必须这样做,如果我是正确的:

System.Drawing.Image myImage = "Image location"; 
ImageListBoxControl.Images.Add(myImage); 

注:我从来没有使用过这种控制。