zoukankan      html  css  js  c++  java
  • WPF的BulletDecorator 对齐控件

    <Window x:Class="WPFBulletDecorator.MainWindow"
    xmlns
    ="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x
    ="http://schemas.microsoft.com/winfx/2006/xaml"
    Title
    ="MainWindow" Height="350" Background="Transparent" WindowStyle="None" AllowsTransparency="True" Width="525" >
    <Grid Background="Transparent">
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="100" />
    <ColumnDefinition />
    </Grid.ColumnDefinitions>
    <!--<Button Height="50" Width="70" />
    <Grid Background="Black" Grid.Column="1" />
    -->
    <WrapPanel>
    <BulletDecorator Height="25" VerticalAlignment="Top" Margin="5 10 0 0">
    <BulletDecorator.Bullet>
    <Label>姓名:</Label>
    </BulletDecorator.Bullet>
    <TextBox Width="100" TextWrapping="Wrap"></TextBox>
    </BulletDecorator>
    <BulletDecorator Height="25" VerticalAlignment="Top" Margin="5 10 0 10">
    <BulletDecorator.Bullet>
    <Label>年龄:</Label>
    </BulletDecorator.Bullet>
    <TextBox Width="100"></TextBox>
    </BulletDecorator>
    <BulletDecorator Margin="5 10 0 0">
    <BulletDecorator.Bullet>
    <CheckBox IsChecked="True"></CheckBox>
    </BulletDecorator.Bullet>
    <TextBlock Width="100" Foreground="Red">在CheckBox之后</TextBlock>
    </BulletDecorator>
    <BulletDecorator Margin="5,10,0,0">
    <BulletDecorator.Bullet>
    <RadioButton/>
    </BulletDecorator.Bullet>
    <TextBlock
    Width="100"
    TextWrapping
    ="Wrap"
    HorizontalAlignment
    ="Left"
    Foreground
    ="Blue"
    Margin
    ="5,0,0,0">
    在Radio后
    </TextBlock>
    </BulletDecorator>
    </WrapPanel>

    </Grid>
    </Window>

    可以 对齐控件的...调整
    BulletDecorator 的属性 子控件跟着调整

  • 相关阅读:
    UIWindow与UIView
    UIView与CALayer 区别
    setter getter 方法
    KVC、KVO 理解
    c语言实现单链表
    浅谈C的应用与常见error
    POJ 3683 Priest John's Busiest Day(2-SAT+方案输出)
    Google Code Jam 2008 Round 1A C Numbers(矩阵快速幂+化简方程,好题)
    POJ 3686 The Windy's(思维+费用流好题)
    POJ 2686 Traveling by Stagecoach(状压二维SPFA)
  • 原文地址:https://www.cnblogs.com/makubexsoft/p/2334088.html
Copyright © 2011-2022 走看看