| | | Advanced StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 7:53:31 PM Posts: 760, Visits: 3,283 |
| | Hi all, I have an MDI parent form with some controls, I need to access another opened form's methods from the main form, but I don't know how. I would need to test if that 2nd form is opened then call its methods and refresh it. How can this be done? Please some sample code if possible. Thanks!
|
| | | | Advanced StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 7:53:31 PM Posts: 760, Visits: 3,283 |
| Humm, I found a way to access the 2nd form's methods like this:'-- Loop through all MDIChildren forms and when found the one we need,'-- use CType() to get access to its custom public methods.For Each loForm As Form In Me.MdiChildren If loForm.Name = "frmCallMonitor" Then CType(loForm, frmCallMonitor).CheckUncheckCallsInList() ' This is a Public custom method in that form. Exit For End IfNext So far this work, but I am not sure if there is a better way than looping all the MdiChildren collection.
|
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 6:26:12 PM Posts: 4,901, Visits: 4,887 |
| | I wouldn't use the name but rather test on the type: If loForm.GetType() Is GetType(MyFormType) Then '--- End If But other than that, the MDIChildren should work fine. |
| | | | Advanced StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 7:53:31 PM Posts: 760, Visits: 3,283 |
| | |
|
|