• wpf学习delegate windows事件


    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);
                
            }

        }

    }

  • 相关阅读:
    netty 服务端 启动阻塞主线程
    idea踩过的坑
    bat批量重命名
    图片上传
    TCP/IP入门指导
    CPU governor调节器汇总
    IT咨询顾问:一次吐血的项目救火
    python 数组
    Python字符串
    基于Python实现对各种数据文件的操作
  • 原文地址:https://www.cnblogs.com/sunbingzibo/p/961640.html
Copyright © 2020-2023  润新知