I am making a random character generator, i have 2 forms, form1 and form2, on my form2 i have the checkboxes there, so if the user checked checkbox1, on my form1 it will only display 1 character, now if the user check all 5 checkboxes, my form1 will generate 5 characters. i have a button on form1 that will trigger an event on generating random characters.
characters: ‘+’,’-‘,’*’,’/’,’%’
how will my code be? I am using
WINDOWS FORMS APPLICATION.
pics here:
form1: http://i49.tinypic.com/30bzos8.png
form2: http://i50.tinypic.com/k00ndt.png
char[] select = new char[] { '+' , '-' , '*' , '/', '%' };
var rand = new Random();
char num = select[rand.Next(5)];
This situations are always interesting since we do not know what you have or not have covered in class. So as per my comment above above in which it appears you gave conflicting answers I will assume that Form2 is being created in the Constructor of Form1 Like so.
You will need some sort of method to determine what Combobox’s are checked, I just XOR’d binary values, and as I said in my Comment I would start Form2 with a ShowDialog and look at the return value to determine wether to exit or continue. I will give you a quick and dirty example, it is up to you to flesh it out. If this is not the case you will need to post a little more Code
Form1
Form2