zoukankan      html  css  js  c++  java
  • WPF Popup绑定目标控件上下左右位置

    Popup的 PlacementTarget属性为绑定某个控件  Placement为上下左右方位,效果如下

    TextBox

    <TextBox x:Name="txt_Code" Grid.Column="1"
             Width="200"
             Height="28"
             FontSize="18"
             HorizontalAlignment="Left"
             Opacity="1"                             
             Margin="20,5,20,5"
             MaxLength="7"                                                                                    
             input:InputMethod.IsInputMethodEnabled="False"
             VerticalContentAlignment="Center"
             >
            <TextBox.Resources>
               <Style TargetType="{x:Type Border}">
                  <Setter Property="CornerRadius" Value="2"/>
                  <Setter Property="BorderBrush" Value="#c1d0dc"/>
               </Style>
            </TextBox.Resources>
    </TextBox>

    Popup

    Popup x:Name="Popup_tick"                           
                                   StaysOpen="False"                              
                                   AllowsTransparency="True"   
                                   IsOpen="False"
                                   PlacementTarget="{Binding ElementName=txt_Code}"
                                   Placement="Right"
                                   >
                            <Path  Data="M 0,100  Q 35,140  54,190 Q 100,45  168,0 S 90,40  50,150 Q 40,136 0,100 Z "
                                   Fill="#89BF04" 
                                   Stretch="Fill"    
                                   Margin="2,0,0,0"
                                   VerticalAlignment="Bottom"
                                   HorizontalAlignment="Center"
                                   Height="28"
                                   Width="30"
                                   />
                        </Popup>
  • 相关阅读:
    汉诺塔
    协变和逆变随笔
    NetCore开发第一步 Log4Net日志引入
    插入排序算法
    选择排序算法
    冒泡排序算法
    排序算法
    线性链表
    SAN
    SAM -- Chap 8 提升方法 自我梳理
  • 原文地址:https://www.cnblogs.com/CityOfThousandFires/p/13280692.html
Copyright © 2011-2022 走看看