在列表框C#中插入中等大小的图像 [英] insert medium sized images in listbox c#

查看:61
本文介绍了在列表框C#中插入中等大小的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想将图片插入列表框,该列表框将以中等尺寸显示(例如5厘米x 5厘米),然后当我单击其中一张图像时,它将显示在一个较大的图片框中,即在列表的左侧.我可以说像画廊.

我怎样才能做到这一点?有任何想法吗?

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?

推荐答案

如果您在列表框中以 System.Windows.Forms.DrawMode.OwnerDrawVariable模式使用自定义图形,则可以执行此操作.
请参阅:
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 [ ^ ].

请参阅以下讨论:
http://stackoverflow.com/questions/472897/c-sharp-can-i-display-images-in-a-list-box [
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


这篇关于在列表框C#中插入中等大小的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆