J
Jeff
I'm using vb in a windows application in visual studio 2005.
I'm new to this and to using parent and child forms.
'In the parent form (as an MDIParent) I have:
Private Sub BtnOpenChild1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BtnOpenChild1.Click
Dim Child1 As New Child1
Child1.MdiParent = Me
Child1.Show()
End Sub
Private Sub BtnOpenChild2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BtnOpenChild2.Click
Dim Child2 As New Child2
Child2.MdiParent = Me
Child2.Show()
End Sub
'In Child1 form I have:
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
Parent1.Label1.Text = ListBox1.SelectedItem
Child2.Label1.Text = ListBox1.SelectedItem '<- this doesn't
work
End Sub
' the above works fine to transfer the value from Child1 listbox1's selected
item to lable1 of the parent form, but I can't figure out how to transfer
the
' same value to a similar label in Child2.
' I've seen several discussions about this on the web, but they seem to be
written for older versions of vb.net, and I'm either not understanding
something or they
don't apply to my version.
Can someone help? (you'll likely have to be relatively specific, since this
is new to me)
Thanks
Jeff
I'm new to this and to using parent and child forms.
'In the parent form (as an MDIParent) I have:
Private Sub BtnOpenChild1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BtnOpenChild1.Click
Dim Child1 As New Child1
Child1.MdiParent = Me
Child1.Show()
End Sub
Private Sub BtnOpenChild2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BtnOpenChild2.Click
Dim Child2 As New Child2
Child2.MdiParent = Me
Child2.Show()
End Sub
'In Child1 form I have:
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
Parent1.Label1.Text = ListBox1.SelectedItem
Child2.Label1.Text = ListBox1.SelectedItem '<- this doesn't
work
End Sub
' the above works fine to transfer the value from Child1 listbox1's selected
item to lable1 of the parent form, but I can't figure out how to transfer
the
' same value to a similar label in Child2.
' I've seen several discussions about this on the web, but they seem to be
written for older versions of vb.net, and I'm either not understanding
something or they
don't apply to my version.
Can someone help? (you'll likely have to be relatively specific, since this
is new to me)
Thanks
Jeff