Showing posts with label Button Style. Show all posts
Showing posts with label Button Style. Show all posts

Monday, January 18, 2010

Designing a Button in WPF - "Simplest yet cool Button"

Hi All,

I have seen a lot of button templates which offer a cool looking styles by overriding the complete button template. Just to give a small style to a button can be complicated as far as overriding the template is concerned. I tried to build a button something like this :



An option could be, to include a new style for my button and override the template. But do we really need to do that???? I don't think so. The button which you are seeing in the Image is actually not a button, it is actually a border object filled with Alice Blue color, and with the corner radius set to 5. There is a textblock object inside the border so that it can contain some text. I didn't use label for that because textblock is lighter than a label.




Now, this control is not yet completed because it doesn't give any notification whenever it is clicked. So I had to include some animation to this button.




Here, I have opted to use code behind to run my animation. Like shown in the figure below :




After including the above code lines, you can see that the border looks like a button and animates as well once you click the control.

HTH,
Vikas

Monday, August 10, 2009

WPF : Styling a Combobox, Button and Tabcontrol

Hi All,

I am still very much like a novice in my WPF skills. Still, I thought to share something useful with the world. I was looking to create a good looking Combobox style for my project. And (obviously after too much efforts), I created one. I know, it is simple but sometimes a novice like me tries to find an already build style so I thought I will post it here :

I created something like this :



You can download the complete project from here : Click here to download.

Please let me know if you have any questions or suggestions.

Thanks,
Vikas