2012-03-27 70 views
0

我有一些麻煩添加項目(字符串圖像)ImageListBoxControl。 圖片我從資源獲取; 我已經添加了圖像的ImageList,但我不知道如何將它添加到ImageListBoxControl,因爲它需要imageIndex指定的,但我不知道如何得到它; 有人能幫助我嗎?C#項目添加到ImageListBoxControl

回答

0

該指數是其中的產品(從0開始),所以我們說,如果它在列表中的第3項的位置,該指數是2(指數是一個int順便說一句,而不是字符串)。

將其添加到您的ImageListBoxControl你必須這樣做,如果我是正確的:

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

注:我從來沒有使用過這種控制。