Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

WPF Apps stop responding to touches while mouse continues to work

$
0
0

WPF applications stop responding to the touchscreen (we are using simple button click events) after some period of time (not consistent) but WILL respond to mouse clicks and the non-WPF applications (explorer, etc) continue to respond to touch just fine.

Because the non-WPF applications respond you can likely rule out the touchscreen drivers.

Very similar to this post: http://social.msdn.microsoft.com/Forums/vstudio/en-US/0edc6c2c-f869-4e76-b207-5b2d21078a7f/touch-stop-working

...except that we are not using a SurfaceWindow nor the 'Surface SDK' and we are using an HP Touchsmart computer.  We are running Windows 7 64 bit using .NET 4.5 (Visual Studio 2012).

I wonder if Microsoft melded the SurfaceWindow and Window code together at some point?

Quick Update: We reproduced the issue with our application by disabling the touchscreen in Device Manager and re-enabling it.  WPF application failed to respond to touches afterwards and the rest of the system was still responding to touches.

And here's a simple MainWindow that you can use in a sample app that will demonstrate the issue:

public partial class MainWindow
    {
        public MainWindow()
        {
            InitializeComponent();
            this.Topmost = true; //required to display the problem
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            MessageBox.Show("Click!");
        }
    }

  And the XAML:

<Window x:Class="TestTouchscreenApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Button Content="Button" HorizontalAlignment="Left" Margin="142,62,0,0" VerticalAlignment="Top" Width="178" Height="88" Click="Button_Click"/>

    </Grid>
</Window>



Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>