正在阅读:使用C#在应用程序间发送消息使用C#在应用程序间发送消息

2004-08-11 10:13 出处:太平洋电脑网 作者:kongxx 责任编辑:huangpeidan


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


察看评论详细内容 我要发表评论
作者笔名 简短内容 发表时间
:

键盘也能翻页,试试“← →”键

关注我们

最新资讯离线随时看 聊天吐槽赢奖品