将text1中的值从form1传递到form3中的文本框。 [英] pass the value in a textbox from form1 to the textbox in form3.

查看:50
本文介绍了将text1中的值从form1传递到form3中的文本框。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有3个表单。单击form1上的按钮后,在单击form2后,它同样显示form2 n,form3出现。我想从form1中的文本框中获取form3中文本框中的值。

i hav 3 forms.After clicking a button on form1 it shows form2 n similarly after clicking form2 ,form3 appears.i want to hav the value in a textbox in form3 from a textbox in form1.

推荐答案

当单击Form1上的按钮时,将文本框的值传递给Form2到Form2的构造函数。
When the button on Form1 is clicked, pass the textbox''s value to Form2 through Form2''s constructor.


我知道如何通过Form2的值,由Form1直接调用。

但是我想知道如何将值传递给Form3,而Form1没有直接调用Form3,Form2调用Form3,而Form2不使用Form3所需的值(从form1传递给form3的值)。


Form1有一个按钮,单击打开Form2,Form2也有一个按钮,单击打开Form3.I想要将Form1中的文本框中的值传递给Form3中的文本框。主要问题是Form3没有直接调用Form3,在这种情况下我想知道如何传递这些形式的值。 <无线电通信/>
希望现在我的问题很明确。解决方案。
I know how to pass the value to Form2,which is directly called by Form1.
But i want to know how to pass value to Form3 which is not directly called by Form1.Form3 is called by Form2,and Form2 does not uses the value that is required by Form3(the value which is passed from form1 to form3).

Form1 has a button which on a click opens Form2 and Form2 also has a button which on click opens Form3.I want to pass the value in a textbox in Form1 to the textbox in Form3.The main problem is that Form3 is not directly called by Form1 in this case i want to know how to pass the values b/w these forms.
hope now my ques is clear.plzz give the solution.





答案已经由r035198x给出了。


您将值从form1传递给form2,从form2传递给form3。


通过form2s构造函数发送值并存储值在form2中的某个全局变量中,当你调用form3将它发送给这个构造函数时,你就得到了form3中的值。


The answer is already given by r035198x .

You pass the value from form1 to form2 and from form2 to form3.

Send the value through the form2s constructor and store the value in some global variable in form2 and when u call form3 send it to this constructor and thats done you got the value in form3.


这篇关于将text1中的值从form1传递到form3中的文本框。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆