D
Dean Slindee
Is there a shorter way of referring to another forms controls/events than
creating a class hold forms, adding a form item each time a new form is
loaded, and then looping thru the class of forms to find the reference?
Like "friend", rather than like below:
Public Class frmMain
Private Sub frmMain_Load
clsForm.Add(Me)
End Sub
End Class
Public Class frmMinor
Private Sub frmMinor_Load
clsForm.Add(Me)
End Sub
Private Sub frmMinor_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
creating a class hold forms, adding a form item each time a new form is
loaded, and then looping thru the class of forms to find the reference?
Like "friend", rather than like below:
Public Class frmMain
Private Sub frmMain_Load
clsForm.Add(Me)
End Sub
End Class
Public Class frmMinor
Private Sub frmMinor_Load
clsForm.Add(Me)
End Sub
Private Sub frmMinor_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