Results 1 to 4 of 4

Thread: Trying to call a method in one form from a different form [resolved]

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2000
    Posts
    770

    Trying to call a method in one form from a different form [resolved]

    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
    Code:
            Dim ScheduleTrip As New frmScheduleTrip
            Me.AddOwnedForm(ScheduleTrip)
            ScheduleTrip.Show()
    In frmScheduleTrip I am trying to refresh UI elements on the main form.
    Code:
    Me.GetType.InvokeMember("RefreshUI", Reflection.BindingFlags.InvokeMethod, Me.Owner.GetType.DefaultBinder, Me.Owner.Handle, New Object)
    But I get System.InvalidCastException

    I'm obviously doing something wrong, any ideas?
    Last edited by nkad; Dec 5th, 2005 at 12:25 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width