E
EstroJen
Hey folks,
I'm trying to reference a control on a main form from a separate class.
For simplicity,
i'll show you a small example snippet. Everything compiles fine, but
nothing actually
happens on the main form.
Is it possible I have to declare and initialize the component in the
Cl_SP class?
Any help is greatly appreciated....Thanks.....Jen
Public Class Form1
#Region
..
lbl1 definition, initialization, etc...
..
#End Region
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim ss As New Cl_Sp
ss.tryit()
End Sub
End Class
Public Class Cl_Sp
Public sFrm As New Form1
Sub tryit()
sFrm.lbl1.Text = "Hey, Hey..."
End Sub
End Class
I'm trying to reference a control on a main form from a separate class.
For simplicity,
i'll show you a small example snippet. Everything compiles fine, but
nothing actually
happens on the main form.
Is it possible I have to declare and initialize the component in the
Cl_SP class?
Any help is greatly appreciated....Thanks.....Jen
Public Class Form1
#Region
..
lbl1 definition, initialization, etc...
..
#End Region
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim ss As New Cl_Sp
ss.tryit()
End Sub
End Class
Public Class Cl_Sp
Public sFrm As New Form1
Sub tryit()
sFrm.lbl1.Text = "Hey, Hey..."
End Sub
End Class