how to put images in listbox

  • Thread starter Thread starter Kanaiya
  • Start date Start date
K

Kanaiya

hello
i want to put bitmap file which is midium size (on disk it is full
size) in to some control which display it like thumbnail type any idea about
it.
 
Hi Gangani,

Wouldn't the Windows.Forms.PictureBox control do this for you ?
Assign the image to the PictureBox's Image property.
Ensure that the size of the picture box equals the size of the
thumbnail that you desire.
Set the SizeMode property to StretchImage enum.
That should shrink the image to fit the size of the PictureBox.

pictureBox.SizeMode = PictureBoxSizeMode.StretchImage;

Regards,
Aravind C
 
What you want is to have an owner drawn listbox.

You need to set the DrawMode to DrawMode.OwnerDrawVariable enum, and also
wireup the listbox' DrawItemEventHandler and MeasureItemEventHandler.

There's various examples - just perform a search on Google for some of the
terms I just described and you should get a few hits.

Hope that helps,
Wim Hollebrandse
http://www.wimdows.net
http://www.wimdows.com
 
Back
Top