VB.NET Call a programmatically made label from another form

  Kiến thức lập trình

I programmatically create a label on form1 and want to call it on form2.

The follow i tryed.

On form1

Dim lblAnimation As New Label

Me.Controls.Add(lblAnimation)

On form2

form1.lblAnimation.text = “Test”

But the part on form2 is not working.

I hope anyone can help. Thanx

I hope some can help me with the richt code.

New contributor

Danny Vershcuur is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT