I want to switch the image that is displayed on a toolStripButton. But I juste can’t find how to do that.
I think it should be something like:
btSearch.Image = new Image("myimage.png");
But it doesn’t work ( new Image seems not to exist).
Thank you for your help
I recommend the
Image.FromStream()method as it doesn’t lock the actual file.For example:
Note that you must keep the stream open for the lifetime of the Image. The stream is reset to zero if this method is called successively with the same stream.
Here’s a previous discussion with an answer from Jon Skeet.