I have a method in a main form that updates the UI. I am trying to call this method from a different form.
So on my main form, a new form is created
In frmScheduleTrip I am trying to refresh UI elements on the main form.Code:Dim ScheduleTrip As New frmScheduleTrip Me.AddOwnedForm(ScheduleTrip) ScheduleTrip.Show()
But I get System.InvalidCastExceptionCode:Me.GetType.InvokeMember("RefreshUI", Reflection.BindingFlags.InvokeMethod, Me.Owner.GetType.DefaultBinder, Me.Owner.Handle, New Object)
I'm obviously doing something wrong, any ideas?




Reply With Quote