大步前行

不管前方有什么,好在有人支持,大步向前走就对了

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
using System;
using System.Windows;
using System.Windows.Input;



namespace wpftest
{
    
/// <summary>
    
/// Description of Class1.
    
/// </summary>

    public class Class1
    
{
        
public Class1()
        
{
        }

        [STAThread]
        
public static void Main()
        
{
            Window win
=new Window();
            win.Title
="hello wpf";
            win.Show();
            
            win.MouseDown
+= new MouseButtonEventHandler(onwinmousedonw);
            
            Application app
=new Application();
            app.Run(win);
        }

        
        
static void onwinmousedonw(object sender,MouseButtonEventArgs  args)
        
{
            Window bb
=sender as Window;
            
string template="windows mouse {0} click at point{1} ";    
            
string msg=string.Format(template,args.ChangedButton,args.GetPosition(bb));
            MessageBox.Show(msg,bb.Title);
            
        }

    }

}

posted on 2007-11-16 14:31  大步前行  阅读(727)  评论(0)    收藏  举报