zoukankan      html  css  js  c++  java
  • WPF学习记录 三、控件模版

    可以给控件增加模版样式

    如下就把一个按钮,完成变成了其它的样式:

        <Window.Resources>
            <ControlTemplate  x:Key="myTemplate" TargetType="Button">
                <Border Background="Red" CornerRadius="5">
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
                        <TextBlock Text="$" VerticalAlignment="Center"></TextBlock>
                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}"></ContentPresenter>
                    </StackPanel>
                </Border>
            </ControlTemplate>
        </Window.Resources>
        <Grid>
            <DockPanel  LastChildFill="False">
                <Button DockPanel.Dock="Left" Height="50" Width="100" Template="{StaticResource myTemplate}" HorizontalAlignment="Center" VerticalAlignment="Center"  Content="确定"></Button>
            </DockPanel>
        </Grid>

  • 相关阅读:
    贪心算法
    分治法
    递归法
    查找二 树与图的搜索
    (转载)查找三 哈希表的查找
    (转载)查找一 线性表的查找
    4.写出完整版的strcpy函数
    3.strcpy使用注意(3)
    2.strcpy使用注意(2)
    1.strcpy使用注意
  • 原文地址:https://www.cnblogs.com/wjx-blog/p/15423550.html
Copyright © 2011-2022 走看看