G
Guest
i have 3 forms
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim frm As New Form2
frm.Show(Me)
End Sub
Private _test As String
Friend Property test() As String
Get
Return _test
End Get
Set(ByVal value As String)
_test = value
End Set
End Property
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
_test = "hallo"
End Sub
End Class
Public Class Form2
Private _test As String
Friend Property test() As String
Get
Return _test
End Get
Set(ByVal value As String)
_test = value
End Set
End Property
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim frm As New Form3
frm.Show(Me)
End Sub
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
_test = "hallo"
End Sub
End Class
Public Class Form3
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
MsgBox(Form1.test)
MsgBox(Form2.test)
End Sub
End Class
why gives pressing the button in form3 the value of form1 but not of form2
??
i wonder what i am missing
regards
Michel
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim frm As New Form2
frm.Show(Me)
End Sub
Private _test As String
Friend Property test() As String
Get
Return _test
End Get
Set(ByVal value As String)
_test = value
End Set
End Property
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
_test = "hallo"
End Sub
End Class
Public Class Form2
Private _test As String
Friend Property test() As String
Get
Return _test
End Get
Set(ByVal value As String)
_test = value
End Set
End Property
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim frm As New Form3
frm.Show(Me)
End Sub
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
_test = "hallo"
End Sub
End Class
Public Class Form3
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
MsgBox(Form1.test)
MsgBox(Form2.test)
End Sub
End Class
why gives pressing the button in form3 the value of form1 but not of form2
??
i wonder what i am missing
regards
Michel