c# - Buttons on form1 will change amount of something in form2 -


I am creating an application, and I want to create different difficulty levels.
One way to change this amount is to call something in Form 2, when click on 1 of 3 buttons in Form 1.

  _multiplicand = randomizer.Next (2, 11); _  

When you click on 1 button on 1, the amount of form 2 (2, 11) is required;
When you click on the button 2 on Form 1, the amount of form 2 is required (10, 21) and when you click on the button 3 Form 1 should be the amount of Form 2 (20, 101);

I know that you can duplicate Form 2 twice and change the amount in each form and simply add the button to other forms (Form 3, Form 4) The application will be larger.

You can type form2 inside your form1 Need to keep the reference and then "submit" the new value:

Something like this:

  form2 form2; Zero Init () {form2 = new form 2 (); // though you make Form 2} zero OnButtonClicked () {var newValue = GetNewValue (); Form2.CurrentValue = newValue; }  

and inside Form2 something like this:

  Public Entry Value {Receive; Set; }  

Note: This code is not working - this should give you an idea to solve such a problem.


Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -