But I want complete control - including the appearance in mouse over, mouse down and disabled situations. ![]() We would already be finished if I just wanted the normal appearance of my button to be changed. So I need another style in my Page.Resources section: The only complicated bit is that I am overriding the focus rectangle drawing, as I want a smaller rectangle than the one that gets drawn by default. This is all fairly straightforward stuff - I am just setting the font and background gradient. We will put this in the Page.Resources section of our XAML file. The first thing to do is to create a Style which sets the properties of the Button that we want to customize. In particular we will look at being able to have complete control over all the visual states, including disabled, mouse over, mouse down and even the appearance of the focus rectangle. In this post I will demonstrate how to create a custom template for a WPF button using XAML.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |