c#WinForm中的图像控件 [英] Image control in c# WinForm

查看:352
本文介绍了c#WinForm中的图像控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在WinForm应用程序中,表单包含一个用于显示缩略图的flowlayoutpanel和一个用于显示我在缩略图上单击的图像的面板。当我点击一个图像时,它将显示在面板中,当我点击缩略图中的所有图像时,它会显示面板中的所有图像。所以,我想在我点击缩略图时一次只显示一个图像。我应该怎么做。

In WinForm application, a form contains one flowlayoutpanel for displaying thumbnails and a panel for displaying the image that i click on thumbnails. When i click on one image it will display in the panel and when i click on all images in the thumbnail its show all images in the panel. So,i want to display only one image at a time when i click on thumbnails. What should i do for it.

推荐答案

假设您使用PictureBoxes来保存每个缩略图,处理每个PictureBox.Click事件,并使用 sender 参数,用于确定单击了哪个PictureBox。然后,您可以使用它的Image属性来更新第二个面板上PictureBox上的Image属性。
Assuming you are using PictureBoxes to hold each of the thumbnails, handle each PictureBox.Click event, and use the sender parameter to determine which PictureBox was clicked. You can then use it's Image property to update the Image property on the PictureBox on the second panel.


这篇关于c#WinForm中的图像控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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