我已经把这个问题看了10次,但每个答案都过于具体了.
原文链接:https://www.f2er.com/vb/255834.html我有两个公共类,每个表单一个.
第一个表单有一个文本框和两个按钮:
Public Class frmAdd Public addvar As String Public Sub UltraButton1_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles btnAddNote.Click If txtAdd.Text = String.Empty Then MsgBox("Please complete the notes textBox!") Else addvar = txtAdd.Text MsgBox(addvar) Close() End If End Sub Public Sub UltraButton2_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles btnCancel.Click Me.Close() End Sub End Class
在第二种形式中,我想采用addvar变量并说出来
Public Sub saveButton_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles addButton.Click frmAdd.show() me.textBox1.text = addvar
如何在vb.net中使用它?