【发布时间】:2016-02-19 07:17:50
【问题描述】:
我有 2 个表格。在 Form1 上,我想在加载时将文本框值传递给表单 2。这是我认为可行的。 Form1 将被加载并运行,数据将填充到 form1 中。我在 form1 中公开文本框的属性。然后我试图在 form2 中使用该暴露的属性。
Public Class form1
Public ReadOnly Property GetTextBox() As String
Get
Return txtbox1.Value
End Get
End Property
在表单 2 上
Dim X As form1
Me.TextBox1.Text = X.GetTextBox
【问题讨论】:
-
X不会引用现有的、打开的 form1 实例 -
文本框的值为'Text',即TextBox1.Text =
-
好吧,为了确定我在 form1 上做了一个 messagebox.show(GetSportsTextBox),它显示了我期望的正确值。