vb.net - image is not a member of system.windows.forms.control -
i have 10 imagebox named imagebox1,imagebox2.....imagebox10
when click button , runs sub called "load" loads images imagelist imageboxes in loop
private sub load(byval task string) dim j integer , ctl1 control j = 1 10 ctl1 = controls(" picturebox" & format(j)) ctl1.image = imglistpics.images(j) 'thİs lİne gİves error(image not member of system.windows.forms.control) ctl.visible = true 'thİs lİne works next end sub
i've tried 1 instead. gives error "system.nullreferenceexception". imagelist not null!
ctype(ctl1, picturebox).image = imglistpics.images(j)
you should this
dim j integer, ctl1 picturebox j = 1 10 ctl1 = ctype(controls("picturebox" & format(j)), picturebox) ctl1.image = imglistpics.images(j - 1) 'note: image index starts 0 ctl1.visible = true next
Comments
Post a Comment