Raise a click event on a form from another form - InfoPath Dev
in

InfoPath Dev

Raise a click event on a form from another form

Last post 07-18-2006 10:43 AM by amerrill. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-12-2006 08:13 AM

    Raise a click event on a form from another form

    Hi, I'm using C# and have a reference to an XDocument that I opened using NewFromSolutionWithData(). The new form contains a button that I would like to click (using code) from the calling form. Is there a way to do this using C#?
  • 07-18-2006 10:11 AM In reply to

    Re: Raise a click event on a form from another form

    Hm, I really don't think you will be able to do this. You can attach to the object model of the opened form, so I would suggest making an "invisible trigger field" with an OnAfterChange event attached to it. Then, from the calling form, change the value of this field (via the object model). This should trigger the OnAfterChange, and then you can call whatever function your button calls.

    This is kind of hacky, but I think it should work. Please let us know how it works out!
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 07-18-2006 10:43 AM In reply to

    Re: Raise a click event on a form from another form

    Thanks Matt..that's a great idea. I think it would definately work if I move all the declarative steps associated with the button click into a common function and then follow your recommendation.

    FYI..I did see an example (in P. Halstead's book: page 165) of calling a method in a remote form by getting an object reference to the remote form's Extention property and calling InvokeMethod(). This requires full trust.

    Thanks again!
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.