Silverlight | Switch

  • Creating a Custom Button

    Aug 7 2009

    For this video I wanted to take a look at creating a custom button control for your application and share with you a tip that I picked up talking with Victor Gaudioso. I recently picked up Victor’s Foundation Expression Blend 3 book and was working through it and ran into this issue which he was kind enough to share some insight into and that is creating a custom content presenter. Victor’s book was actually neck and neck with the product release so there are some differences between what has been released to the public and what he has in his book so he has been really great clearing up some of those differences.

    Hopefully this tutorial is a help to you understanding some the techniques in creating a custom button control and take it from me understanding how to make a custom content presenter will be very handy in the future.

    I recommend you check out both Victor’s book and his blog at http://victorgaudioso.wordpress.com for some great info on Expression Blend 3.

    As always please let me know what you think, and if there are any aspects of Expression Blend you would like me to investigate to share as a video I would love to know what you would like to see.

    Thanks!
    J.

    Click Here To Watch Creating a Custom Button

    Bookmark and Share

Comments

  • 09/01/09 6:56 pm

    Victor Gaudioso victorgaudioso.wordpress.com

    Hey Jason,
    Great tutorial! I never even thought of changing the transition time of the Pressed State to 0 seconds. Brilliant! Very informative as well. Keep up the great work. Victor

  • 10/22/09 8:23 am

    Kathryn Van Auken  

    Thanks for the great tutorial. That content presenter has been driving me crazy!

  • 10/22/09 10:58 am

    Jason  

    Kathryn,

    I’m so glad to hear this was helpful for you, thanks for taking the time to comment.

    Best,
    J.

  • 10/23/09 2:58 am

    Anders SannagĂ„rd  

    Hey Jason.

    This site is going to very helpful to me…
    There is a few questions about the video, custom button (7aug).

    I,ve tryed to do point by point,a button after the video but when I is going to set states, defaultstates as “mouseover” and so on is missing. Any idea?

    Second… As i can see, the button is beeing in fixed size,with other words it,s necessary to make a set of buttons in different size?

    Best regards

    Anders

  • 10/23/09 9:04 am

    Jason  

    Anders,

    Thanks for writing, you are right this example wasn’t the best for making a resizable custom button. I improved on this button inside the Resource Dictionary tutorial. Have a look at that one and see if you don’t get closer to what you would like. If you still have any questions drop me another line here and we’ll figure it out.

  • 10/25/09 5:26 pm

    Anders SannagĂ„rd  

    Hello again Jason.

    Not guite what I,ve meant..
    Both issue still remains. In my project I want to create a button very similar “create custom button video”. With rounded corners and glass look and give it some specific behaviors by the states tab in blend3,( witch shows no default states if do it exactly by the video)and then convert it to button control so I can reuse it via a dll (resource dict). And hopfully only
    one size so can use it like a orginalbutton.

    The Resource Dictionary tutorial, showed me some thing I,ve supected. A better solotion on align center in contentpresenter, so that is going to help me with one of the problems.
    And also put my owncreated objects in a resource dict.

    But adjust a orginalbutton to get rounded corner seems me to be impossible. Or is it not?
    I,ve guess its necessary to solve these problems first.

    Best

    Anders

 

Return to article.

Your Thoughts

Microsoft® Tag