Notifications
Clear all
[Closed] ListView images problem
Aug 25, 2009 6:56 pm
I’m having problems to get icons to display in ListView. My code is:
rollout roller "Imagelist" width:400 height:800
(
dotNetControl imageView "System.Windows.Forms.ListView" width:380 height:780
fn initImageView lv =
(
local items = #()
imageList = dotNetObject "System.Windows.Forms.ImageList"
imageClass = dotNetClass "System.Drawing.Image"
file = "C:/test.jpg"
lv.View = (dotNetClass "System.Windows.Forms.View").LargeIcon
for x = 0 to 10 do
(
item=dotNetObject "System.Windows.Forms.ListViewItem" "testItem"
imageList.images.add (imageClass.Fromfile file)
append items item
)
lv.items.addrange items
lv.LargeImageList = imageList
)
on roller open do
(
initImageView imageView
)
)
createDialog roller
For some reason icons aren’t displayed. Propably just some small error I can’t see :wip:
EDIT: I added imageindex for item and now everything works like a charm…