【发布时间】:2016-12-18 14:05:27
【问题描述】:
我要实现我的应用程序的一些秘密功能和它们只能按ctrl调用左边点击一个按钮的下半部分。这是可能的WPF来实现?我试图创建一个演示应用程序调试不显示我的单击事件处理程序中的光标位置信息。下面是我的测试代码。有什么想法吗?
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApplication1"
mc:Ignorable="d"
Title="MainWindow" Height="255.284" Width="313.918">
<Grid>
<Button x:Name="button" Content="Button" HorizontalAlignment="Left" Margin="81,89,0,0" VerticalAlignment="Top" Width="158" Height="49" Click="button_Click"/>
</Grid>
</Window>
using System.Windows;
namespace WpfApplication1
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void button_Click(object sender, RoutedEventArgs e)
{ // <----- set break point here, can't find cursor info in e and sender
}
}
}
【问题讨论】:
标签: c# wpf events event-handling