/images/avatar.jpg

发个C# 窗口互相传值的实例代码

  这个实例很简单,一看就懂。用VS2008编写!      实例是2个窗口动态传值。已经打包上传了,在文章最下方点击下载!

https://img.9x81.com/wp-content/uploads/2010/07/20100711.jpg
20100711

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
//namespace 窗口传值
public partial class Form2 : Form
public string returnValue;//给方框一内容赋值
public string returnValuea;//给方框二内容赋值
InitializeComponent();
this.textBox1.Text = txtValue;//写入值
this.textBox2.Text = txtValuea;//写入值
private void Form2_Load(object sender, EventArgs e)
private void button1_Click(object sender, EventArgs e)
this.textBox1.Text;//给方框一重新赋值
this.textBox2.Text;//给方框二重新赋值
this.Close();
private void button2_Click(object sender, EventArgs e)


namespace 窗口传值{    public partial class Form2 : Form    {        public string returnValue;//给方框一内容赋值        public string returnValuea;//给方框二内容赋值        public Form2(string txtValue,string txtValuea)//接收FORM1传过来的值        {            InitializeComponent();            this.textBox1.Text = txtValue;//写入值            this.textBox2.Text = txtValuea;//写入值
 }
 private void Form2_Load(object sender, EventArgs e)        {
 }
 private void button1_Click(object sender, EventArgs e)        {            returnValue = this.textBox1.Text;//给方框一重新赋值            returnValuea = this.textBox2.Text;//给方框二重新赋值            this.Close();        }
 private void button2_Click(object sender, EventArgs e)        {
 }    }}

C#FORM-POST

到底应该怎么样!

  遇到太多让人蛋疼的选择,而且是那种一个出错就万劫不复的那种,额,当然这夸张了。

  哎。看图说话! 尽在不言中!

https://img.9x81.com/wp-content/uploads/2010/07/c.jpg
c

选择是对的

  不能在一起证明没有缘分,既然没有缘分那不能在一起也么有什么好遗憾的了!

  这话真有哲理`