Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

wpf round button

<Button>
    <Button.Resources>
        <Style TargetType="Border">
            <Setter Property="CornerRadius" Value="5"/>
        </Style>
    </Button.Resources>
</Button>
Comment

WPF Rounded Button

<Button Content="Button">
	<Button.Resources>
		<Style TargetType="Border">
			<Setter Property="CornerRadius" Value="15"></Setter>
		</Style>
	</Button.Resources>
</Button>
Comment

wpf round button



<Style x:Key="RoundCorner" TargetType="{x:Type Button}">
    <Setter Property="HorizontalContentAlignment" Value="Center"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="Padding" Value="1"/>
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type Button}">
                <Grid x:Name="grid">
                    <Border x:Name="border" CornerRadius="8" BorderBrush="Black" BorderThickness="2">
                        <Border.Background>
                            <RadialGradientBrush GradientOrigin="0.496,1.052">
                                <RadialGradientBrush.RelativeTransform>
                                    <TransformGroup>
                                        <ScaleTransform CenterX="0.5" CenterY="0.5" 
                                                        ScaleX="1.5" ScaleY="1.5"/>
                                        <TranslateTransform X="0.02" Y="0.3"/>
                                    </TransformGroup>
                                </RadialGradientBrush.RelativeTransform>
                                <GradientStop Offset="1" Color="#00000000"/>
                                <GradientStop Offset="0.3" Color="#FFFFFFFF"/>
                            </RadialGradientBrush>
                        </Border.Background>
                        <ContentPresenter HorizontalAlignment="Center"
                                          VerticalAlignment="Center"
                                          TextElement.FontWeight="Bold">
                        </ContentPresenter>
                    </Border>

                </Grid>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsPressed" Value="True">
                        <Setter Property="Background" TargetName="border">
                            <Setter.Value>
                                <RadialGradientBrush GradientOrigin="0.496,1.052">
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.5" ScaleY="1.5"/>
                                            <TranslateTransform X="0.02" Y="0.3"/>
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Color="#00000000" Offset="1"/>
                                    <GradientStop Color="#FF303030" Offset="0.3"/>
                                </RadialGradientBrush>
                            </Setter.Value>
                        </Setter>
                    </Trigger>
                    <Trigger Property="IsMouseOver" Value="True">
                        <Setter Property="BorderBrush" TargetName="border" Value="#FF33962B"/>
                    </Trigger>
                    <Trigger Property="IsEnabled" Value="False">
                        <Setter Property="Opacity" TargetName="grid" Value="0.25"/>
                    </Trigger>

                </ControlTemplate.Triggers>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>


Comment

WPF Rounded Button

<Button Content="Button">
	<Button.Resources>
		<Style TargetType="Border">
			<Setter Property="CornerRadius" Value="15"></Setter>
		</Style>
	</Button.Resources>
</Button>
Comment

WPF Rounded Button

<Button Content="Button">
	<Button.Resources>
		<Style TargetType="Border">
			<Setter Property="CornerRadius" Value="10"></Setter>
		</Style>
	</Button.Resources>
</Button>
Comment

WPF Rounded Button

<Button Content="Button">
	<Button.Resources>
		<Style TargetType="Border">
			<Setter Property="CornerRadius" Value="15"></Setter>
		</Style>
	</Button.Resources>
</Button>
Comment

WPF Rounded Button

<Button Content="Button">
	<Button.Resources>
		<Style TargetType="Border">
			<Setter Property="CornerRadius" Value="15"></Setter>
		</Style>
	</Button.Resources>
</Button>
Comment

PREVIOUS NEXT
Code Example
Csharp :: atan2 speed unity 
Csharp :: Delayed respawn timer 
Csharp :: dotnet core clickable row 
Csharp :: asp.net store list in web.config 
Csharp :: selecteditem treeview wpf 
Csharp :: how to c# 
Csharp :: difference between iqueryable and ienurable 
Csharp :: How to cache database tables to prevent many database queries in Asp.net C# mvc 
Csharp :: SceneManagment by BuildIndex 
Csharp :: pass viewbag selectlistitem to razor 
Csharp :: gcm_sender_id convert text 
Csharp :: dapper extension 
Csharp :: Task timed out after 10.02 seconds 
Csharp :: how to list all registered users asp net 
Csharp :: sortdescriptions wpf 
Csharp :: v bux free 
Csharp :: show double in textbox c# 
Csharp :: mono cast 
Csharp :: List foreach 
Csharp :: class merging 
Csharp :: serenity get id from insert repository 
Csharp :: convert excel to datatable using epplus 
Csharp :: Filter list contents with predicate (anonymous method) 
Csharp :: c# remove numericUpDown white space 
Csharp :: lambda distinct by property 
Csharp :: unity diference protected and virtual 
Csharp :: closedxm Iworksheet excel formulal 
Csharp :: visual studio pre build event not working 
Csharp :: c# uint 
Csharp :: create new directory netrw 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =