Data Passing Between Classes

fixitchris

Member
Joined
Aug 9, 2005
Messages
7
Is there a problem with this setup? I am trying to use a value from one private Dataset to populate another private Dataset...

Code:
Public Class Form1
   Private Sub ListBox1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.Click
        Dim frm2 As New Form2
        frm2.Text = frm2.Text & " HNDL" & Convert.ToString(frm2.Handle)
        colForms.Add(frm2)
        frm2.Show()

        [B]frm2.stest = ListBox1.Text[/B]
    End Sub
End Class
Code:
public class Form2
    [B]protected friend sTest as string[/B]
end class

or is it better to set up properties?
Code:
public class form2
   Private m_SQLparam As String

    Public WriteOnly Property SQLparam() As String
        Set(ByVal value As String)
            m_SQLparam = value
        End Set
    End Property
end class

and call frm2.sqlparam= listbox1.text on form1?


OR theres a better way yet???
 
Last edited by a moderator:
Back
Top