开发者

C# - Image as a clickable button

开发者 https://www.devze.com 2022-12-27 21:38 出处:网络
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.

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?


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号