Posts

Showing posts with the label WPF UserControl

Donate

Rounded Corner Button Example In WPF

Image
In WPF, you can alter the corner radius of a button using Style class. In Setter class, set the Property value to Template. Inside the Setter class, add a ControlTemplate class that will target the Button control. After that, you can add a Border class and then setting it's CornerRadius property with an integer value of the desired radius. The example below is a user control that has a Button and a Style resource that will alter the Button's corner radius. User Control <UserControl x:Class= "WPFButtonCornerRadiusXAMLVBForums.UCRoundedButton" xmlns= "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x= "http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc= "http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d= "http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable= "d" d:DesignHeight= "45"

Donate