Home > Net >  C # form mutual action between solution
C # form mutual action between solution

Time:11-17

Forms became a life form two, form two generated form three, now want to use the controls within the forms of three keystrokes form a, need how to implement,

CodePudding user response:

Forms two increase form 1 local variables, constructor, add structure to form 1 when the incoming parameters, save to a local variable inside the
Forms three increase form 1 local variables, constructor, add structure to form 1 when the incoming parameters, save to a local variable inside the
In form a second generated form called when constructors, pass oneself to form 2
Inside the form 2, generated form three called when adding a constructor, the preservation of forms a to form three

In a form to add a function to operate within the space of the public, hypothesis for a function

So in the form in three forms an object, can through the object to invoke a function

CodePudding user response:

Add a static variable in form1. Cs
Public static Form1 form;

Can in form2, used in form3
Form1. Form. The control

CodePudding user response:

Three methods
Forms a subscription form 2 forms 2 subscription form 3 event of
2. The forms 1 overall as a parameter to form 2 continue to form 3
3. Create a message queue, form 1, 2, 3 can send a message to process the message
  •  Tags:  
  • C#
  • Related