D
Dean Slindee
I have two different independent forms that need to talk to one another to
syncronize
their displays.
Is there a shorter way of referring to another form's controls/events than
creating a class or utilizing an ArrayList to hold references to the forms,
adding a form item to the array each time a new form is
loaded, and then looping thru the class of forms to find the reference?
'clsForm is a class similar to an ArrayList
Public Class frmMain
Private Sub frmMain_Load
clsForm.Add(Me)
End Sub
End Class
Public Class frmAnother
Private Sub frmAnother_Load
arrForm.Add(Me)
End Sub
Private Sub frmAnother_AnyEvent
Dim frm As Form
For Each frm In clsForm
If frm.Name = cfrmMain Then
Dim frmMain As frmMain = frm
Dim etvw As New
System.Windows.Forms.TreeViewEventArgs(frmMain.tvwAdmin.SelectedNode,
TreeViewAction.ByMouse)
Call frmMain.tvwAdmin_AfterSelect(Me, etvw)
Exit For
End If
Next
frm = Nothing
End Sub
End Class
Thanks,
Dean Slindee
syncronize
their displays.
Is there a shorter way of referring to another form's controls/events than
creating a class or utilizing an ArrayList to hold references to the forms,
adding a form item to the array each time a new form is
loaded, and then looping thru the class of forms to find the reference?
'clsForm is a class similar to an ArrayList
Public Class frmMain
Private Sub frmMain_Load
clsForm.Add(Me)
End Sub
End Class
Public Class frmAnother
Private Sub frmAnother_Load
arrForm.Add(Me)
End Sub
Private Sub frmAnother_AnyEvent
Dim frm As Form
For Each frm In clsForm
If frm.Name = cfrmMain Then
Dim frmMain As frmMain = frm
Dim etvw As New
System.Windows.Forms.TreeViewEventArgs(frmMain.tvwAdmin.SelectedNode,
TreeViewAction.ByMouse)
Call frmMain.tvwAdmin_AfterSelect(Me, etvw)
Exit For
End If
Next
frm = Nothing
End Sub
End Class
Thanks,
Dean Slindee