Quote:
-How can i array of random numbers that represent the dice index ?
-loop take 10 numbers
-save the random numbers in array or use an array list(better)
If you are trying to fill an array with random numbers that represent dice rolls, then that's simple:
private Random die = new Random();
...
int[] rolls = new int[10];
for (int i = 0; i < rolls.Length; i++)
{
rolls[i] = die.Next(6) + 1;
}
Don't use ArrayList - it'a very, very out of date. There are better constructs called Generic Collections which are much easier to use:
List<int> rolls = new List<int>();
for (int i = 0; i < 10; i++)
{
rolls.Add(die.Next(6) + 1);
}
With generic collections you don;t have to cast teh values to a particular datatype when you try to use them, and the system enforces that you can only put the right type of data in them.
Quote:
-use list box to show the 10 random saved numbers
myListBox.DataSource = rolls;
Quote:
How can I pass from form into another ?
That is complicated: it depends on a lot of factors, and it probably outside your knowledge set at the moment - you really need to get basic stuff like this well and truly sorted before you start wading into the complex stuff.
But...
Transferring information between two forms, Part 1: Parent to Child[
^]
Transferring information between two forms, Part 2: Child to Parent[
^]
Transferring information between two forms, Part 3: Child to Child[
^]
Quote:
What if I want to add a timer for the dice app ?
System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
timer.Interval = 1000;
timer.Tick += timer_Tick;
timer.Start();
...
void timer_Tick(object sender, EventArgs e)
{
}