Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# - Image as a clickable button

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?

like image 627
fonix232 Avatar asked Apr 25 '10 08:04

fonix232


2 Answers

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

like image 150
Oded Avatar answered Nov 12 '22 11:11

Oded


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.

like image 45
Gekkehond Avatar answered Nov 12 '22 12:11

Gekkehond