how to put a value to an array when a checkbox is checked? c#?
- by Jan Darren Noroña
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)];