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

WPF氣泡提示框的簡單制作

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

本文實例為大家分享了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" />

先在前臺創(chuàng)建一個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="請輸入用戶名"/>
    </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>

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

相關(guān)文章

最新評論

弥渡县| 武穴市| 鹤庆县| 延长县| 敦煌市| 漳浦县| 梧州市| 康马县| 盐源县| 龙川县| 双柏县| 保靖县| 乡城县| 息烽县| 舞阳县| 宁城县| 余庆县| 邯郸县| 柘荣县| 汝阳县| 济源市| 江口县| 乌拉特前旗| 布尔津县| 容城县| 七台河市| 仙桃市| 灵台县| 龙南县| 克什克腾旗| 肃北| 砀山县| 开平市| 尉氏县| 磐石市| 邵武市| 福海县| 安多县| 吉木乃县| 阳谷县| 绥中县|