如何使用WatermarkedTextbox

来源:互联网 发布:西安广电网络大酒店 编辑:程序博客网 时间:2024/06/13 04:57

1.下载

下载WatermarkedTextbox的dll,(下载地址)

2.导入

 

 

 

这要等上数十秒钟,请耐心等待

 

 

3.3

 

 

3.引用

  1. <UserControl x:Class="DiggSample.Page"
  2.     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  3.     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
  4.     xmlns:local="clr-namespace:Microsoft.Windows.Controls;assembly=Microsoft.Windows.Controls.WatermarkedTextBox"
  5.     Width="600" Height="500">

 在原来的基础上加上这样一句话:

xmlns:local="clr-namespace:Microsoft.Windows.Controls;assembly=Microsoft.Windows.Controls.WatermarkedTextBox"

4.使用

 

使用的时候这样写:例如:

<local:WatermarkedTextBox Grid.Column="1" FontSize="14" Watermark="Topic..."/>