Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/304.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 单击按钮需要鼠标移动_C#_Uwp_Raspberry Pi_Windows 10 Iot Core - Fatal编程技术网

C# 单击按钮需要鼠标移动

C# 单击按钮需要鼠标移动,c#,uwp,raspberry-pi,windows-10-iot-core,C#,Uwp,Raspberry Pi,Windows 10 Iot Core,我在点击按钮时遇到了一个奇怪的问题。单击按钮时,除非在释放左按钮之前移动鼠标,否则不会将其注册为单击。下面是我在一个新程序中使用的内容,用于验证我在正在工作的程序中没有执行任何操作 我使用的是Raspberry Pi 2和版本10.0.16212.1000 xaml: c#: 名称空间App1 { /// ///可以单独使用或在框架内导航到的空页。 /// 公共密封部分类主页面:第页 { 公共主页() { this.InitializeComponent(); } 私有无效按钮\u单击(

我在点击按钮时遇到了一个奇怪的问题。单击按钮时,除非在释放左按钮之前移动鼠标,否则不会将其注册为单击。下面是我在一个新程序中使用的内容,用于验证我在正在工作的程序中没有执行任何操作

我使用的是Raspberry Pi 2和版本10.0.16212.1000

xaml:


c#:

名称空间App1
{
/// 
///可以单独使用或在框架内导航到的空页。
/// 
公共密封部分类主页面:第页
{
公共主页()
{
this.InitializeComponent();
}
私有无效按钮\u单击(对象发送者,路由目标e)
{
Debug.WriteLine(“单击按钮”);
}
} 
}

你确定你的鼠标很好吗?我可以在我的电脑上运行你的代码。是的,我一直在我的HTPC上使用鼠标/键盘。代码可以在电脑上正确运行,但编译并加载到raspberry pi。我现在必须移动鼠标按钮,以显示鼠标已按下。我在raspberry pi 3上测试了16237版本,它可以工作。你试过这个版本吗?
<Page
    x:Class="App1.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:App1"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Button x:Name="button" Content="Button" HorizontalAlignment="Left" Margin="175,216,0,0" VerticalAlignment="Top" Click="button_Click"/>

    </Grid>
</Page>
namespace App1
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            this.InitializeComponent();
        }

        private void button_Click(object sender, RoutedEventArgs e)
        {
            Debug.WriteLine("Button Clicked");
        }
    } 
}