VB.NET:将数据从表单传输到表单 [英] VB.NET: Transferring Data From Form to Form
问题描述
有没有人知道如何将数据从form1中的TextBox1传输到form2中的
textBox2 .....
这意味着我填写后在textBox1中的任何数据中单击下一步按钮...
它将带我到form2 ....并且我在form1中键入的数据将
出现在textbox2中的form2
谢谢
-
toytoy - 论坛会员
http://www.visual-basic-data-mining.net/forum
Does anyone have any idea how to transferring data from TextBox1 in form1 to
textBox2 in form2.....
That means after i fill in any data in textBox1 and click Next button...
It will bring me to form2....and there the data that i key in form1 will
appear to form2 in textbox2
Thanks
--
toytoy - forum member
http://www.visual-basic-data-mining.net/forum
推荐答案
您必须声明一个Public变量,否则将文本框声明
更改为Public。
然后在表单2中,您将能够访问Form1的公共成员。
-
Gerry O'' Brien [MVP]
Visual Basic .NET(VB.NET)
" http://www.visual-basic-data -mining.net/forum" < SI ****** @ gmail.com>在消息新闻中写了
:%2 *************** @ tk2msftngp13.phx.gbl ...
You must declare a Public variable, or else change the textbox declaration
to Public.
Then in form 2 you will be able to access the public members of Form1.
--
Gerry O''Brien [MVP]
Visual Basic .NET(VB.NET)
"http://www.visual-basic-data-mining.net/forum" <si******@gmail.com> wrote
in message news:%2***************@tk2msftngp13.phx.gbl...
有没有人有任何想法如何从form1中的TextBox1传输数据
到form2中的textBox2 .....
这意味着在我填写textBox1中的任何数据并单击下一步按钮。 ..
它会把我带到form2 ....然后我在form1中键入的数据将在textbox2中显示为form2
谢谢
http://www.visual-basic-data-mining.net/forum
Does anyone have any idea how to transferring data from TextBox1 in form1
to
textBox2 in form2.....
That means after i fill in any data in textBox1 and click Next button...
It will bring me to form2....and there the data that i key in form1 will
appear to form2 in textbox2
Thanks
--
toytoy - forum member
http://www.visual-basic-data-mining.net/forum
来自你的这个问题,给你很多消息。
非常重要的是你在哪里创建你的其他消息。形式以及如何做到这一点。
(在VBNet中有很多方法可以做到这一点)
当它已知时是一块蛋糕,主要是帮助你。
也许你可以告诉我们。
Cor
Hi,
This question from you, gives forever a lot of messages.
Very important is where you create your "other" form and how you do that.
(There are a lot of ways to do that in VBNet)
When that is known than it is a piece of cake to help you mostly.
Maybe you can show us that.
Cor
Cor Ligthert <无************ @ planet.nl>在消息新闻中写道:< OK ************** @ TK2MSFTNGP10.phx.gbl> ...
"Cor Ligthert" <no************@planet.nl> wrote in message news:<OK**************@TK2MSFTNGP10.phx.gbl>...
这个问题来自你,永远给了很多消息。
非常重要的是你在哪里创建你的其他消息。形式以及你如何做到这一点。
This question from you, gives forever a lot of messages.
Very important is where you create your "other" form and how you do that.
无论其他的地点和方式如何。表单已创建,将数据传递到表单以显示的最佳方法是通过属性
或该表单的方法。这里的问题是如何将数据传递给
给定表单?
在我看来,公共变量(这是全局的应该很少使用整个
应用程序。我也认为,将表单的UI对象公之于众不是一个好主意。为表格创建一个表格或方法更好地接受
数据进行展示。
何处和怎么样创建表单将简单地确定您对该表单的
*引用*的位置。但是,这是一个不同的问题。关于创建表单的时间和地点的
问题是如何引用我已经创建或即将创建的
表单?
Regardless of where and how the "other" form is created, the best
method of passing data to a form for display is either by a property
or method of that form. The issue here is "How do I pass data to a
given form?"
In my opinion, public variables (that is global to the whole
application) should rarely be used. It is also my opinion that it is
not a good idea to make UI objects of a form public. It would be
better to create a form or a method for the form that is to accept the
data for display.
"Where" and "how" a form is created will simply determine where your
*reference* to that form is. However, that is a different issue. The
issue of when and where a form is created is "How do I reference a
form I''ve already created or am about to create?"
这篇关于VB.NET:将数据从表单传输到表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!