Question: You will be creating a Visual Studio C# Form Project. This program is part 1 of a larger program. Eventually, it will play a game

You will be creating a Visual Studio C# Form Project. This program is part 1 of a larger program. Eventually, it will play a game of a slide puzzle those games with tiles that you slide around to make a picture or put numbers in order. Name the form, frmSlide, and set the title The Start button (forms Accept button) will do nothing this week. The Reset button will reset the puzzle (numbers 1 through 8 and the blank back to their original/solved spots). The Exit button (forms Cancel button) will end the program. The 9 Buttons that make up the puzzle can be used to move a tile to a new location. I highly recommend that moving is really swapping the text, which means the 9 Buttons stay in their original locations, only the text changes. When the user clicks on a Button with text (the non-blank one), swap the text with the blank Button making it look like the 2 tiles switched places. You MUST use a two-dimensional array to hold the 9 Buttons. Youll create the 9 Buttons using code, not the ToolBox and Properties window. Heres sample of code that can create a Button, assign some properties, assign it an event handler, and place it on the form. You can put this in the Form Load event:

The Start button (forms Accept button) will do nothing this week. The Reset button will reset the puzzle (numbers 1 through 8 and the blank back to their original/solved spots). The Exit button (forms Cancel button) will end the program. The 9 Buttons that make up the puzzle can be used to move a tile to a new location. I highly recommend that moving is really swapping the text, which means the 9 Buttons stay in their original locations, only the text changes. When the user clicks on a Button with text (the non-blank one), swap the text with the blank Button making it look like the 2 tiles switched places. You MUST use a two-dimensional array to hold the 9 Buttons. Youll create the 9 Buttons using code, not the ToolBox and Properties window. Heres sample of code that can create a Button, assign some properties, assign it an event handler, and place it on the form. You can put this in the Form Load event: Button b; // This can be a single Button or an array of Buttons // If you have an array of buttons, // then all b references b = new Button(); // will be a single element from the array // x and y of upper left corner (to put at x=100, y=200 b.Location = new Point(100, 200); b.Height = 40; b.Width = 40; b.Text = ""; b.TextAlign = ContentAlignment.MiddleCenter; b.Font = new Font(FontFamily.GenericSerif, (float) 15.0); // allNumberButton_Click is the name of the // function that should be called on click b.Click += new System.EventHandler(this.allNumberButton_Click); this.Controls.Add(b);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!