2011-05-24 57 views

回答

0
<Grid x:Name="SearchPanel"> 
    <TextBox x:Name="txtQuery" Text="{Binding Query, Mode=TwoWay}" Margin="8" Padding="3, 3, 21, 3" 
     GotFocus="txtQuery_GotFocus" LostFocus="txtQuery_LostFocus"/> 

    <TextBlock x:Name="lblSearchStatus" VerticalAlignment="Center" Margin="13, 0" 
     Text="Enter some text ..." 
     IsHitTestVisible="False"> 
    </TextBlock> 
</Grid> 

然后隐藏在lblSearchStatus和txtQuery_GotFocus在txtQuery_GotFocus再次显示。也可以通过故事板完成。重要的部分是为TextBlock叠加层设置IsHitTestVisible为false。

+0

谢谢你,非常感谢你 – user765864 2011-05-24 09:24:38

+0

感谢Oliver的回复。 – user765864 2011-05-24 16:35:08