使用c#在应用程序之间发送消息

使用c#在应用程序之间发送消息

ID:22213059

大小:63.00 KB

页数:6页

时间:2018-10-27

使用c#在应用程序之间发送消息_第1页
使用c#在应用程序之间发送消息_第2页
使用c#在应用程序之间发送消息_第3页
使用c#在应用程序之间发送消息_第4页
使用c#在应用程序之间发送消息_第5页
资源描述:

《使用c#在应用程序之间发送消息》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库

1、使用C#在应用程序之间发送消息首先建立两个C#应用程序项目。    第一个项目包含一个odel;  usingSystem.odel.Containerponents=null;    [STAThread]  staticvoidMain(){   Application.Run(ne1());  }    publicForm1()  {   Initializeponent();  }  protectedoverridevoidDispose(booldisposing)  {   if(disposing)   {   if(ponents!=null)   {    p

2、onents.Dispose();   }   }   base.Dispose(disposing);  }    #regionessageBox.Sho的代码如下:    usingSystem;  usingSystem.Text;  usingSystem.Dra.Collections;  usingSystem.ponentModel;  usingSystem.odel.Containerponents=null;    [STAThread]  staticvoidMain(){   Application.Run(ne1());  }    publicTest

3、Form1()  {   Initializeponent();  }  protectedoverridevoidDispose(booldisposing)  {   if(disposing)   {   if(ponents!=null)   {    ponents.Dispose();   }   }   base.Dispose(disposing);  }    #region_CLICK=0x00F5;   Messagemsg=Message.Create(hsg.Hsg,msg._CHAR=0x0102;   IntPtrhs10.essage.Create(

4、hsg.Hsg,msg.essage(IntPtrh,IntPtrlParam);  }    以上代码可以在VS.中编译运行,也可以使用csc.exe编译,如使用一下命令行:    F:>csc.exeForm1.cs    F:>csc.exeTestForm1.cs    编译后生成两个.exe文件。    首先运行第一个程序,显示Form1窗体,然后运行第二个程序,显示TestForm1窗体。    在TestForm1窗体上点击button1按钮(向Form1窗体上的button1发送消息)此时显示对话框提示“Thisisbutton1click!”。    

5、在TestForm1窗体上点击button2按钮(向Form1窗体上的textBox1发送消息)此时在Form1上的textBox1上显示“测试aaa”。首先建立两个C#应用程序项目。    第一个项目包含一个odel;  usingSystem.odel.Containerponents=null;    [STAThread]  staticvoidMain(){   Application.Run(ne1());  }    publicForm1()  {   Initializeponent();  }  protectedoverridevoidDispose(bool

6、disposing)  {   if(disposing)   {   if(ponents!=null)   {    ponents.Dispose();   }   }   base.Dispose(disposing);  }    #regionWindo.Windos.Button();   this.textBox1=ne.Windos.TextBox();   this.SuspendLayout();   //   //button1   //   this.button1.Location=ne.Drae=button1;   this.button1.TabI

7、ndex=0;   this.button1.Text=button1;   this.button1.Click=ne.EventHandler(this.button1_Click);   //   //textBox1

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。