MyTextbox.xaml

(完整代码) 1KB

<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
	x:Class="WpfApplication1.MyTextBox"
	x:Name="UserControl"
	d:DesignWidth="150" d:DesignHeight="26">

	<Grid x:Name="LayoutRoot">
		<TextBox      FontSize="14" Padding="2,3"  x:Name="userName"  TextChanged="userName_TextChanged" >
            
            
			<TextBox.Resources>
				<VisualBrush x:Key="HelpBrush" TileMode="None" Opacity="1"   Stretch="None" AlignmentX="Left" >
					<VisualBrush.Visual>
						<Grid Background="White" Width="150" Height="26" >
							<TextBlock FontStyle="Normal" Text="{Binding  }"  x:Name="txtblock"  Margin="1,0,0,0"  Padding="5,3,2,3" HorizontalAlignment="Left" VerticalAlignment="Center"   FontSize="12"  FontFamily="SimSun"  />
						</Grid>
					</VisualBrush.Visual>
				</VisualBrush>
			</TextBox.Resources>
			<TextBox.Style>
				<Style TargetType="{x:Type TextBox}">
					<Style.Triggers>
						<Trigger Property="Text" Value="{x:Null}">
							<Setter Property="Background" Value="{StaticResource HelpBrush}"/>
						</Trigger>
						<Trigger Property="Text" Value="">
                                
							<Setter Property="Background" Value="{StaticResource HelpBrush}"/>
						</Trigger>
					</Style.Triggers>
				</Style>
			</TextBox.Style>

		</TextBox>
	</Grid>
</UserControl>

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。