WPF的事件用法,基本上跟一般的Window Form用法是一样的 using System; using System.Windows; using System.Windows.Input; namespace Cloud.HandleEvent { class HandleEvent { [STAThread] public static void Main() { Window win = new Window(); win.Title = "Cloud Orz"; win.MouseDown += new MouseButtonEventHandler(win_MouseDown); Application app = new Application(); app.Run(win); } static void win_MouseDown(object sender, MouseButtonEventArgs e) { Window win = sender as Window; string str = string.Format("Window clicked with {0} button at point ({1})",e.ChangedButton,e.GetPosition(win)); MessageBox.Show(str); } } }