sportdog

导航

 
<Window x:Class="WpfStudy2018.StyleButton"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="StyleButton" Height="300" Width="300">
    <Window.Resources>
        <Style x:Key="{x:Type Button}" TargetType="Button">
            <Setter Property="Width" Value="60"></Setter>
            <Setter Property="Height" Value="36"></Setter>
            <Setter Property="Margin" Value="5"></Setter>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition></ColumnDefinition>
            <ColumnDefinition></ColumnDefinition>
        </Grid.ColumnDefinitions>
        
        <Button Content="MyButton" Margin="5" Grid.Column="0" />
        <Button Content="Null" Style="{x:Null}" Grid.Column="1" Width="30" Height="60"></Button>
    </Grid>
</Window>

 

posted on 2018-03-07 14:53  sportdog  阅读(176)  评论(0)    收藏  举报