如何调用函数到Eventhandler [英] How to Call Function To Eventhandler

查看:102
本文介绍了如何调用函数到Eventhandler的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

public void KeyBoard_Lock(object sender, System.EventArgs e)
        {
            if (receivedData == "###LOCK###")
            {
             actHook = new UserActivityHook(); // crate an instance with global hooks 
             actHook.KeyDown += new KeyEventHandler(MyKeyDown);
             actHook.KeyPress += new KeyPressEventHandler(MyKeyPress);
             actHook.KeyUp += new KeyEventHandler(MyKeyUp);
            }

        }



那么如何在函数中调用这个Eventhandler?


So how to call this Eventhandler in function?

推荐答案

按键功能可重写,如果我试图停止键输入,我会在那里调用它。
The key press function is overrideable, i would call it there if im trying to stop key input.


这篇关于如何调用函数到Eventhandler的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆