c# - Clicking a button on one form while clicking on a different form -
I have two programs, both different names, which run independently of each other, I click on a button I would like to call the incident to be done on a form if it is being executed by clicking on a button on the other.
I was able to do this by publicizing namespace.form1 Call by clicking on .button_click
but it can not work how to do this in C #.
You must pass the reference to the form2 object ( which is executed by clicking on For launching the button in the RCGI application ) for the form1 object.
If Form 2 is a separate add-in ( provided by a third party ) and any API functions, then I guess what you want to achieve Too difficult to do If you have created this add-in, you can expose a function so that other apps can click the button on this add-in.
In addition, the mode of communication between the two add-ins also depends on how the add-ins is being loaded in the ARCGS application (in-process or out-process) depending on it , You can either call directly to another function or you may have to go through the Remoting, RPC, etc.
The above answer is based on my understanding of how the Open button can be clicked on the other add-in and can not be related to this specific case.
Edit: Added after the comment of OP below
P> As you can see both projects Code and can update them, it's good, we can do whatever we wantAfter referring to Form 1 item 1 of Form 1, using all the methods of the system Will be enabled (only if you click the button in Form 2, it will not be accessible)
One Create a new project, which will act as a base, and an interface will be IOutsideCallable
Interface IOutsideCallable {void PerformButtonClick (); }
Now, in your projects of Form 1 and Form 2, implement the above interface in Form 2 in the above project
Comments
Post a Comment