I would like to be able to start up multipli window forms

Mickeys
Mickeys used Ask the Experts™
on
I have a game. Every game will only take 5 players. So I thought if the user would get a startup form.....asking how many players. There they might enter 7 players. Then I would like two game windows to open. That will say.....one with 5 players and one with 2 players. Is that possible?

WIll it be something like.... but with a for loop???
private void ok_Click(object sender, System.EventArgs e)
 {

    MyGame mygame = new MyGame();
mygame.Show()

}
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior Consultant - Deloitte
Commented:

private void ok_Click(object sender, System.EventArgs e)
 {
 
	if(noOfUSers > 5)
	{
		int numbers = noOfUsers / 5;
		int mod = noOfUsers % 5;
		for(int i= 0 ; i<numbers; i++)
		{
		    MyGame mygame = new MyGame();
		    mygame.Players = 5; // Property
		    mygame.Show();	
		}
		if(mod > 0)
		{
		    MyGame mygame = new MyGame();
		    mygame.Players = mod; // Property
		    mygame.Show();	
		}
	}
	else
	{
	    MyGame mygame = new MyGame();
	    mygame.Players = noOfUsers; // Property
	    mygame.Show();	
	}
 
}

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial