Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hey guys,

I would like to insert pictures to a list box that will be shown in a medium size (for example 5 cm x 5 cm), then when i click on one of the images it'll be shown in a larger picture box that is to the left of the list. I can say it's like a gallery.

How can I do that? any ideas?
Posted

1 solution

You can do it if you use custom drawing in a list box with the mode System.Windows.Forms.DrawMode.OwnerDrawVariable.

Please see:
http://msdn.microsoft.com/en-us/library/system.windows.forms.combobox.drawitem.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.drawmode.aspx[^].

Please see this discussion:
http://stackoverflow.com/questions/472897/c-sharp-can-i-display-images-in-a-list-box[^].

You will find a simple code sample in the first answer.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900