Mdi子窗口间消息通信
来源:岁月联盟
时间:2005-01-24
namespace Vavic
{
/// <summary>
/// 当信息更改是通知其他的窗口重新加载数据
/// 使用方法为:1)通知信息更改
/// Notify.Instance().SendMessage(100, "Form1 Activate test notify event");
/// 其中第一个参数为信息号,第二个参数为信息描述
/// 2)收取信息
/// 使用方法,在每个FORMLOAD事件中加入如下语句
/// Notify.Instance().OnNotifyEvent += new Notify.NotifyEvent(OnNotifyEvent);
/// 同时编写如下的方法用于重新加载数据
///protected void OnNotifyEvent(object sender, Notify.NotifyEventArgs e)
///{
/// if (e.Code == Notify.CompanyInfo)
/// System.Diagnostics.Debug.WriteLine(string.Format(" Form1 Code={0}, Message = {1}", e.Code,e.Message));
//
下一篇:如何有效的使用C#读取文件