how to put a value to an array when a checkbox is checked? c#?
Posted
by
Jan Darren Noroña
on Stack Overflow
See other posts from Stack Overflow
or by Jan Darren Noroña
Published on 2012-11-25T03:34:53Z
Indexed on
2012/11/25
5:04 UTC
Read the original article
Hit count: 202
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)];
© Stack Overflow or respective owner