Prabhee
Prabhee

Reputation: 71

Textbox tag and IsHitTestVisible property

<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"/> 

What is the role of IsHitTestVisible property on TextBox?

Upvotes: 7

Views: 9293

Answers (3)

gaurawerma
gaurawerma

Reputation: 1826

When you have a control inside another control, like, If you have a TextBox inside... lets say, another TextBox. Then by setting the isHitTestvisible property of the parent control to False you allow the user to type in the child TextBox. If you set it to True then the RoutedEvent will be handled at the parent control level.

This property is mostly used when you work with Adorners.

Upvotes: 13

Tarion
Tarion

Reputation: 17134

true if this element could be returned as a hit test result from at least one point; otherwise, false. The default value is true.

Source: MSDN

See also: Hit Testing in the Visual Layer

Upvotes: 0

Related Questions