我想知道如何将值从 form1 传递到另一个表单的公共子。问题是它说“在这种情况下它是不可访问的,因为它是‘私人的’。”
我尝试将 Form 1 Private Sub 更改为 Public Sub,但仍然存在相同的错误。我应该如何使它工作?
Public Class Form1
Dim test(), text1 As String
Const asd = "abcabc"
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
text1 = Space(LOF(1))
test = Split(text1, asd)
HOST = test(1)
End Sub
我想将 HOST = test(1) 值传递给另一种形式
Public Class Form2
Public Sub Check()
'get the value to here
End Sub