摘要: 构造函数后加:this() public class cstus { private int age; public cstus(string a) { } public cstus() { this.age = 25; } public int Age ... 阅读全文
posted @ 2008-07-03 16:38 hemingchen 阅读(263) 评论(0) 推荐(0) 编辑
摘要: 下面的示例程序阐释如何在一个类中引发一个事件,然后在另一个类中处理该事件。AlarmClock 类定义公共事件 Alarm,并提供引发该事件的方法。AlarmEventArgs 类派生自 EventArgs,并定义 Alarm 事件特定的数据。WakeMeUp 类定义处理 Alarm 事件的 AlarmRang 方法。AlarmDriver 类一起使用类,将使用 WakeMeUp 的 AlarmR... 阅读全文
posted @ 2008-07-03 11:40 hemingchen 阅读(378) 评论(0) 推荐(0) 编辑
摘要: public class MyButton : System.Web.UI.WebControls.WebControl, IPostBackEventHandler ...{ public event EventHandler Click; protected virtual void onClick(EventArgs e) ...{ ... 阅读全文
posted @ 2008-07-03 00:37 hemingchen 阅读(1714) 评论(0) 推荐(0) 编辑