网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

C#实现在应用程序间发送消息的方法示例-创新互联

本文实例讲述了C#实现在应用程序间发送消息的方法。分享给大家供大家参考,具体如下:

在洮北等地区,都构建了全面的区域性战略布局,加强发展的系统性、市场前瞻性、产品创新能力,以专注、极致的服务理念,为客户提供做网站、成都做网站 网站设计制作按需求定制开发,公司网站建设,企业网站建设,成都品牌网站建设,全网营销推广,外贸营销网站建设,洮北网站建设费用合理。

首先建立两个C#应用程序项目。

第一个项目包含一个Windows Form(Form1),在Form1上有一个Button和一个TextBox。

第二个项目包含一个Windows Form(Form1),在Form1上有两个Button,分别用来测试第一个应用程序中Button的Click事件和修改第一个应用程序中TextBox的值。

第一个应用程序中Form的代码如下:

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
public class Form1 : System.Windows.Forms.Form {
 private System.Windows.Forms.Button button1;
 private System.Windows.Forms.TextBox textBox1;
 private System.ComponentModel.Container components = null;
 [STAThread]
 static void Main() {
 Application.Run(new Form1());
 }
 public Form1()
 {
 InitializeComponent();
 }
 protected override void Dispose( bool disposing )
 {
 if( disposing )
 {
 if(components != null)
 {
 components.Dispose();
 }
 }
 base.Dispose( disposing );
 }
 #region Windows 窗体设计器生成的代码
 private void InitializeComponent()
 {
 this.button1 = new System.Windows.Forms.Button();
 this.textBox1 = new System.Windows.Forms.TextBox();
 this.SuspendLayout();
 //
 // button1
 //
 this.button1.Location = new System.Drawing.Point(32, 24);
 this.button1.Name = "button1";
 this.button1.TabIndex = 0;
 this.button1.Text = "button1";
 this.button1.Click += new System.EventHandler(this.button1_Click);
 //
 // textBox1
 //
 this.textBox1.Location = new System.Drawing.Point(32, 64);
 this.textBox1.Name = "textBox1";
 this.textBox1.TabIndex = 1;
 this.textBox1.Text = "textBox1";
 //
 // Form1
 //
 this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
 this.ClientSize = new System.Drawing.Size(292, 266);
 this.Controls.Add(this.textBox1);
 this.Controls.Add(this.button1);
 this.Name = "Form1";
 this.Text = "Form1";
 this.ResumeLayout(false);
 }
 #endregion
 private void button1_Click(object sender, System.EventArgs e) {
 MessageBox.Show("This is button1 click!");
 }
}

另外有需要云服务器可以了解下创新互联建站www.cdcxhl.com,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


名称栏目:C#实现在应用程序间发送消息的方法示例-创新互联
网页链接:http://bjjierui.cn/article/jdhos.html

其他资讯