什么是对象发送者,EventArgs e?

编程入门 行业动态 更新时间:2024-10-11 17:28:40
本文介绍了什么是对象发送者,EventArgs e?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class Search : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } }

对象发件人有什么用途,EventArgs e 在上面的代码中? 提前谢谢。

What is the use of object sender, EventArgs e in the code above? Thanks in advance.

推荐答案

Page_Load 是一个事件处理程序它基本上说明了加载页面时会发生什么。 sender 是导致此事件的原因, e 包含有关该事件的信息。例如,如果你从一定高度掉球, Page_Load is an event handler. It basically tells what should happen if a page is loaded. sender is what caused this event and e contains information about the event. For instance, if you drop a ball from certain height, event: you dropping the ball sender: you e: information about the event. Something like from which height you dropped the ball.

基本上,Page_Load函数是一个事件处理程序。 sender是事件引发对象,e变量是事件参数。请查看以下主题: 处理和提升事件 [ ^ ] [ ^ ] 代表(C#编程指南) [ ^ ] Basicly the Page_Load function is an event handler. The sender is the event raising object, and the e variable is the event arguments. Take a look into the following subjects: Handling and Raising Events[^][^] Delegates (C# Programming Guide)[^]

更多推荐

什么是对象发送者,EventArgs e?

本文发布于:2023-11-25 20:15:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1631194.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:对象   EventArgs

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!