When using XAML layout, sometimes in order to make the interface Metro-like, some buttons need to use circles instead of the default rectangles. The following Button style can solve this problem and can be modified according to your needs. Of course, if you are familiar with Bland, you can use it directly to draw the style you need, but is it faster to paste the code? Copy code The code is as follows:<Style x:Key="btnNext" TargetType="Button"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Grid> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Pressed"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="rectangle"> <DiscreteObjectKeyFrame KeyTime="0"> <DiscreteObjectKeyFrame.Value> <Thickness>-3</Thickness> </DiscreteObjectKeyFrame.Value> </DiscreteObjectKeyFrame> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="Normal"/> <VisualState x:Name="Disabled"/> <VisualState x:Name="MouseOver"/> </VisualStateGroup> <VisualStateGroup x:Name="FocusStates"> <VisualState x:Name="Focused"/> </VisualStateGroup> </VisualStateManager.VisualStateGroups> <Rectangle x:Name="rectangle" RadiusY="25" RadiusX="25" Stroke="Blue" StrokeThickness="4"> </Rectangle> <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> </Grid> </ControlTemplate> </Setter.Value> </Setter> <Setter Property="Margin" Value="5"/> <Setter Property="Width" Value="50"/> <Setter Property="Height" Value="50"/> <Setter Property="FontSize" Value="120"/> <Setter Property="Foreground" Value="White"/> </Style> |
<<: Detailed explanation of VUE's data proxy and events
>>: Two ways to understand CSS priority
I started configuring various environments this a...
SRIOV introduction, VF pass-through configuration...
CentOS 8 is now available! CentOS 8 and RedHat En...
MySQL 5.7.17, now seems to be the latest version,...
What are slots? We know that in Vue, nothing can ...
mysql-5.7.17.msi installation, follow the screens...
This article shares the specific code for JavaScr...
The full name of Blog should be Web log, which me...
【Introduction】: Handtrack.js is a prototype libra...
I suddenly thought of this method when I was writi...
1.Jenkins installation steps: https://www.jb51.ne...
Table of contents Step 1: Install node_modules in...
Let's start with the body: When viewing a web ...
Code: Copy code The code is as follows: <!DOCTY...
Copy code The code is as follows: <iframe src=...