using System; using System.Windows; using System.Windows.Input; using System.Windows.Media; class MainClass : Window { RadialGradientBrush brush; [STAThread] public static void Main() { Application app = new Application(); app.Run(new MainClass()); } public MainClass() { Title = "title"; } protected override void OnMouseDown(MouseButtonEventArgs args) { Point ptMouse = args.GetPosition(this); Console.WriteLine(ptMouse.X); Console.WriteLine(ptMouse.Y); if (args.ChangedButton == MouseButton.Left) { Console.WriteLine("left"); } else if (args.ChangedButton == MouseButton.Right){ Console.WriteLine("right"); } } }