#679 – Setting IsHitTestVisible to False Prevents Interaction with Controls

When you set the IsHitTestVisible property to false for a user interface element, it will no longer respond to mouse input and will not fire mouse-related events.

With IsHitTestVisible set to false, you therefore can’t use the mouse to interact with a user interface element at all.  In the example below, we can’t use the mouse to give the elements focus or to click or select any of them.

        <Button Content="You can't Click this" HorizontalAlignment="Center" Margin="5" Click="Button_Click_1"
        <TextBox Text="You can't Edit this" HorizontalAlignment="Center" Margin="5"
        <CheckBox Content="You can't Check this" HorizontalAlignment="Center" Margin="5"
        <ComboBox HorizontalAlignment="Center" Margin="5" SelectedIndex="0"
                <ComboBoxItem Content="You can't Select this"/>
                <ComboBoxItem Content="Or this"/>

Notice, however, that you can still interact with the elements using the keyboard.  For example, you can tab to the Button and then press Enter to trigger its Click event.