How to create/make rounded corner buttons in WPF?

前端 未结 12 2149
礼貌的吻别
礼貌的吻别 2020-12-04 11:39

I need to create a rounded corner glossy button in WPF. Can anyone please explain me what steps are needed?

12条回答
  •  心在旅途
    2020-12-04 12:15

    I know this post is super old, but I have an answer that's surprisingly missing from the above and is also much simpler than most.

    
    

    Since the default ControlTemplate for the Button control uses a Border element, adding a style for Border to the Button's resources applies that style to that Border. This lets you add rounded corners without having to make your own ControlTemplate and without any code. It also works on all varieties of Button (e.g. ToggleButton and RepeatButton).

提交回复
热议问题