C# - Image as a clickable button

2019-03-24 21:59发布

I want to make some custom controls, with images as buttons. I don't want images ON buttons - I want to totally replace the button with an image read from a file. Is it possible?

2条回答
劳资没心,怎么记你
2楼-- · 2019-03-24 22:48

You can use the PictureBox control and use the Click event on it to handle clicks.

查看更多
干净又极端
3楼-- · 2019-03-24 22:50

You could use the image in the Button's BackgroundImage and change the FlatStyle to flat, and the colors of FlatAppearance MouseDownBackColor & MouseOverBackColor to transparent. It should look the same as a normal picture/picturebox with properties and events of a Button.

查看更多
登录 后发表回答