Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Image thumbnail in a WinForms listbox

I am trying to display a thumbnail inside a listbox in a Windows Form application. I've read around and seen all sorts of suggestions, but I'm looking for the simplest one. Here's the details of what I'm trying to do.

I am trying to display a thumbnail of an image AND display text next to it.

I've looked at ListViews and they don't seem to offer what I am looking for. Any code would be appreciated.


1 Answers

set your listbox to ownerdraw

then in the itemdraw event (or is it drawitem?) grab your image and draw it in the space allotted (e.Graphics.DrawImage), then draw the test of the item next to it (e.Graphics.DrawString)

like image 112
Sam Axe Avatar answered Dec 14 '25 18:12

Sam Axe