I want to make a custom button control (image button is ok) like this one.
I'm a new user, so I can't post image here. So I uploaded the picture here
I'm kind of desperate right now after trying some tutorials
Any suggestion is highly appreciated.
Thanks
I think the simplest way is set some properties of the button like below and
then write the code for
Update:
I don't know whether I am going correct or not but I think You can also achive your goal by putting a Button and a label inside a panel and arrange them according to your choice. Make the
button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
at initial withLabel.Text="Normal"
. Then on Mouse enter to the Panel draw a rectangle with a border around the button and change the text of the label to "Hover
". Like that Clicking on the Panel also you change the rectangle border according to you and make thelabel.Text="OnClick"
.You could create a class that inherits from Button to keep all your styling in one place. To do the hover and pressed states you can override the mouse enter / leave events of the button and change style.
Here is an example from one of our projects (I changed the colours but your get the idea). Where we change some colours you could switch the images.
Can't see the picture but I guess you can change the border of the button and set a background image.