文本框标记和 IsHitTestVisible 属性
本文关键字:IsHitTestVisible 属性 文本 | 更新日期: 2023-09-27 18:26:47
<TextBox Foreground="Black"
FontFamily="Times New Roman"
FontWeight="Bold"
FontSize="15"
MaxHeight="50"
Margin="6,95,40.067,0"
Name="txt1" VerticalAlignment="Top"
IsHitTestVisible="False"
Height="30"
Grid.Row="4"
Grid.Column="2"/>
IsHitTestVisible 属性在 TextBox 上的作用是什么?
当您在
另一个控件中有一个控件时,例如,如果内部有一个文本框...比方说,另一个文本框。然后,通过将父控件的 isHitTestvisible
属性设置为 False,允许用户在子文本框中键入内容。如果将其设置为 True,则将在父控件级别处理路由事件。
此属性最常在处理 Adorners
时使用。
查看此帖子
http://social.msdn.microsoft.com/Forums/en/wpf/thread/7c352827-b4ed-493c-8a68-58179ad801fc
http://msdn.microsoft.com/en-us/library/system.windows.uielement.ishittestvisible.aspx
如果此元素可以从至少一个点作为命中测试结果返回,则为 true;否则为 false。默认值为 true。
来源: MSDN
另请参阅:视觉层中的命中测试