可有人请在最外行条款如何使用的EventArgs解释一下吗? [英] Can someone please explain to me in the most layman terms how to use EventArgs?

查看:128
本文介绍了可有人请在最外行条款如何使用的EventArgs解释一下吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道他们有事情做与代表。我试过,但我还是不COM prehend如何可以使用它们。我知道一些关于事件处理程序,但我真正想知道的是我怎么可以使用普通的旧EventArgs一个是大多数方法的一部分。下面的例子

I know they have something to do with delegates. I've tried but I still don't comprehend how to use those either. I know a little about event handlers but what I really want to know is how I can use plain old eventargs that are part of most methods. example below

void Page_Load(object sender, EventArgs e)
{
myText.Value = "Hello World!";
}

感谢您的时间和放大器;考虑,我只是想成为最好的codeR我就可以了。

Thanks for your time & consideration, I am just trying to be the best coder I can be.

迈克

推荐答案

EventArgs的筹款活动时,类作为数据载体。它们通常包含涉及被引发事件的信息。

EventArgs classes are used as data carriers when raising events. They typically contain information that is related to the event being raised.

许多事件使用EventArgs类,不包括特定信息。该类还用作所有其他的EventArgs类的基类。更具体的EventArgs类的一个例子是 TreeNodeEventArgs 类,是由一些事件中使用,并包含有关哪些树节点,该事件与

Many events use the EventArgs class, which contains no particular information. This class also serves as the base class for all other EventArgs classes. One example of a more specific EventArgs class is the TreeNodeEventArgs class, that is used by a number of events, and that contains information about which TreeNode that the event is related to.

在某些情况下,EventArgs的类可以被设计成使得它们允许事件处理程序将数据回通信以引发事件的源,这样一个例子是 CancelEventArgs 类。

In some cases, EventArgs classes can be designed so that they allow event handlers to communicate data back to the source that raised the event, an example of that is the CancelEventArgs class.

这篇关于可有人请在最外行条款如何使用的EventArgs解释一下吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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