zoukankan      html  css  js  c++  java
  • 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);
                
            }

        }

    }

  • 相关阅读:
    Spring_3.1
    handler发消息的形式
    css元素排列
    利用Socket远程发送文件
    jtree添加节点
    url传参中文乱码
    struts action和jsp之间的传值
    Struts 404 The requested resource is not available
    tomcat server需要重启的时刻
    c++获取系统时间(引用别人的博文)
  • 原文地址:https://www.cnblogs.com/sunbingzibo/p/961640.html
Copyright © 2011-2022 走看看