如何获得表单克隆变量?

Public Sub playbtnclick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles playbutton.Click 

Dim form2clone As New Form2

form2clone.Tag = selectedpicid

form2clone.Show()

End Sub

Public Sub labelclick(ByVal sender As System.Object, ByVal e As System.EventArgs)

Dim lbl As Label = sender

For Each frm2 As Form2 In 'How can I find specified form2?

If frm2.Tag = searchtag Then

TextBox1.Text = frm2.justvariable & lbl.Tag

Exit For

End If

Next

End Sub

如何在VB.net中找到指定的form2并获取表单克隆变量?如何获得表单克隆变量?

回答:

您可以将您的form2添加到列表中,然后遍历该列表。 例如

Dim ALForm2 as new list (of Form2) 

Dim form2clone As New Form2

form2clone.Tag = selectedpicid

form2clone.Show()

ALForm2.Add (form2clone)

然后可以遍历ALForm2

以上是 如何获得表单克隆变量? 的全部内容, 来源链接: utcz.com/qa/258809.html

回到顶部