最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

WPF氣泡提示框的簡(jiǎn)單制作

 更新時(shí)間:2017年09月28日 14:49:19   作者:PettyHandSome  
這篇文章主要為大家詳細(xì)介紹了WPF氣泡提示框的簡(jiǎn)單制作,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了WPF氣泡提示框的具體代碼,供大家參考,具體內(nèi)容如下

直接上代碼

<TextBox Name="account" GotFocus="account_GotFocus" LostFocus="account_LostFocus" Style="{StaticResource LabelTextBox}" xl:ControlAttachProperty.Label="用戶名:" Foreground="Black" Margin="10,10,273,271" Width="Auto" />

先在前臺(tái)創(chuàng)建一個(gè)TextBox,然后各種附加的屬性加上去:如圖所示

<Popup Name="pop3" AllowsTransparency="True" StaysOpen="True" PopupAnimation="Fade" IsOpen="False" PlacementTarget="{Binding ElementName=account}" Placement="Right" >
  <Label Style="{StaticResource tipLable}">
    <StackPanel Orientation="Horizontal">
     <Label Content="請(qǐng)輸入用戶名"/>
    </StackPanel>
  </Label>
 </Popup>

效果圖:

樣式代碼:

<Style TargetType="Label" x:Key="tipLable">
  <Setter Property="Template">
   <Setter.Value>
    <ControlTemplate TargetType="{x:Type Label}">
     <Grid>
      <Border CornerRadius="4" BorderBrush="Black" BorderThickness="1" VerticalAlignment="Top" Margin="8.5,0,0,0" Background="Yellow" HorizontalAlignment="Left" Padding="5">
       <ContentPresenter />
      </Border>
      <Canvas Width="10" Height="10" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,10,0,0" Background="Transparent">
       <Path Stroke="Black" StrokeThickness="0.5" Fill="Yellow">
        <Path.Data>
         <PathGeometry Figures="M 10,0 L 10,0,0,5 L 0,5,10,10"/>
        </Path.Data>
       </Path>
      </Canvas>
     </Grid>
    </ControlTemplate>
   </Setter.Value>
  </Setter>
 </Style>

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論

隆林| 仙居县| 德安县| 霍山县| 平定县| 武邑县| 沙湾县| 理塘县| 紫金县| 望都县| 夏河县| 荣昌县| 黄浦区| 栾城县| 孟津县| 永吉县| 揭阳市| 商南县| 灵石县| 仙桃市| 汉沽区| 黑河市| 洛阳市| 广宁县| 二连浩特市| 余姚市| 滨州市| 叶城县| 紫云| 平遥县| 广丰县| 阳山县| 望谟县| 固原市| 凤台县| 武平县| 台前县| 彭泽县| 东台市| 沙河市| 巴马|