ICANN认证国际域名顶级注册机构
网站建设,域名注册,空间租用,软件销售,广告设计 域名注册,空间租用, 网站建设,东莞网页设计,域名注册,网站推广,网站开发,网页设计 网站推广,,百度推广,新浪推广,雅虎推广,网易推广 标志设计,画册设计,包装设计,VI策划,企业形象顾问 连邦软件加盟店,提供销遥行,管家婆,速达,用友ERP,诺顿等软件报价及销售 建站必读 腾达网络,上网帮助中心, 腾达为东莞等地,提供网站建设,网站推广,广告设计,软件销售等优质服务!
建站必读


 
 
当前位置:首页 -> 建站必读 -> .NET技术
使用C#在应用程序间发送消息
用C#在应用程序间发送消息



作者:kongxx



首先建立两个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!");

}

}











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



using System;

using System.Text;

using System.Drawing;

using System.Collections;

using System.ComponentModel;

using System.Windows.Forms;

using System.Runtime.InteropServices;



public class TestForm1 : System.Windows.Forms.Form {

private System.Windows.Forms.Button button1;

private System.Windows.Forms.Button button2;



private System.ComponentModel.Container components = null;



[STAThread]

static void Main() {

Application.Run(new TestForm1());

}



public TestForm1()

{

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.button2 = new System.Windows.Forms.Button();

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);

//

// button2

//

this.button2.Location = new System.Drawing.Point(32, 64);

this.button2.Name = "button2";

this.button2.TabIndex = 0;

this.button2.Text = "button2";

this.button2.Click += new System.Eve
 
 
本站关键词:
|网页空间申请 东莞|东莞软件公司|东莞电脑外包服务|东莞网页服务|东莞网站公司|东莞企业邮箱|东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站||网页空间申请 东莞|东莞软件公司|东莞电脑外包服务|东莞网页服务|东莞网站公司|东莞企业邮箱|东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站||网页空间申请 东莞|东莞软件公司|东莞电脑外包服务|东莞网页服务|东莞网站公司|东莞企业邮箱|东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站||网页空间申请 东莞|东莞软件公司|东莞电脑外包服务|东莞网页服务|东莞网站公司|东莞企业邮箱|东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站||网页空间申请 东莞|东莞软件公司|东莞电脑外包服务|东莞网页服务|东莞网站公司|东莞企业邮箱|东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站||网页空间申请 东莞|东莞软件公司|东莞电脑外包服务|东莞网页服务|东莞网站公司|东莞企业邮箱|东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站||网页空间申请 东莞|东莞软件公司|东莞电脑外包服务|东莞网页服务|东莞网站公司|东莞企业邮箱|东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站||网页空间申请 东莞|东莞软件公司|东莞电脑外包服务|东莞网页服务|东莞网站公司|东莞企业邮箱|东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站||网页空间申请 东莞|东莞软件公司|东莞电脑外包服务|东莞网页服务|东莞网站公司|东莞企业邮箱|东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站||网页空间申请 东莞|东莞软件公司|东莞电脑外包服务|东莞网页服务|东莞网站公司|东莞企业邮箱|东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站||网页空间申请 东莞|东莞软件公司|东莞电脑外包服务|东莞网页服务|东莞网站公司|东莞企业邮箱|东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站||网页空间申请 东莞|东莞软件公司|东莞电脑外包服务|东莞网页服务|东莞网站公司|东莞企业邮箱|东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站||网页空间申请 东莞|东莞软件公司|东莞电脑外包服务|东莞网页服务|东莞网站公司|东莞企业邮箱|东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站||网页空间申请 东莞|东莞软件公司|东莞电脑外包服务|东莞网页服务|东莞网站公司|东莞企业邮箱|东莞平面设计|东莞产品推广|网站建设公司|网站开发 东莞|网络公司 东莞|东莞做网站|
域名注册 | 虚拟主机 | 网站建设 | 网站推广 | 广告设计 | 帮助中心 | 软件中心 | 关于腾达
东莞市腾达信息工程有限公司      本站网络实名: 东莞网站建设
地址:东莞市新城市中心区第一国际B座610   邮编:523007
电话:0769-22026071 22026072 传真:0769-22026076 24小时服务热线:13712032014
© 2002~2005 腾达网络   版权所有