简体   繁体   English

如何在C#中从图片框取消设置图像?

[英]How to unset an image from a picturebox in c#?

I have a picturebox that is intended to have different kinds of images based on the situation. 我有一个图片框,旨在根据情况使用不同种类的图像。 On the other way around, it must have no picture when it's not needed. 另一方面,不需要时它必须没有图片。 How to unset an image from that picturebox in c#? 如何在C#中从该图片框取消设置图像?

Use the Image property to set the image to display. 使用Image属性设置要显示的图像。

Set it to null to display nothing. 将其设置为null显示任何内容。

You can use pictureBox1.Image = null; 您可以使用pictureBox1.Image = null; to accomplish that. 做到这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM