悟生慧

 

2011年6月8日

c#的委托和事件

摘要: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace GoldCubePos.App{ public partial class Form1 : Form { private delegate void ShowName(object sender);//定义委托 private 阅读全文

posted @ 2011-06-08 17:34 悟生慧 阅读(174) 评论(0) 推荐(0)

C# 的 Delegate 学习

摘要: C# 的 Delegate TypeDelegate 是一种函数指针,但与普通的函数指针相比,区别主要有三:1) 一个 delegate object 一次可以搭载多个方法(methods)[译注1],而不是一次一个。当我们唤起一个搭载了多个方法(methods)的 delegate,所有方法以其“被搭载到 delegate object 的顺序”被依次唤起——稍候我们就来看看如何这样做。2) 一个 delegate object 所搭载的方法(methods)并不需要属于同一个类别。一个 delegate object 所搭载的所有方法(methods)必须具有相同的原型和形式。然而,这些方 阅读全文

posted @ 2011-06-08 17:07 悟生慧 阅读(260) 评论(0) 推荐(0)

当前日期和选择日期之间的时差显示

摘要: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace GoldCubePos.App{ public partial class Form1 : Form { public Form1() { InitializeComponent(); ToolStripControlHost 阅读全文

posted @ 2011-06-08 16:30 悟生慧 阅读(285) 评论(0) 推荐(0)

导航