C # program Two-Sudoku mini-game (1. UI design)

Source: Internet
Author: User

The teacher assigned the project needs to compile software, just recently has been playing on the mobile phone sudoku, so you want to spend free time to write a PC on a single-machine version of the Sudoku mini-game, practice their own programming skills. There is no guarantee that every day there is time to spend on this small program, but will try to stick to it, every completion of a little things, will be the core code and the relevant information found out, is still in the grammar has not finished the stage, want to take this opportunity to record their growth ~

First, UI design

1. Use ComboBox control to select game difficulty;

2. Use the Label control to display the cumulative time of the game;

3. Nine background is a Label control that sets the background color;

4. Each grid is a Textbox control with its "Multiline" property set to "True" so that it can be adjusted to its height (refer to link); nine UI when start/pause/Resume/end Game The corresponding changes are as follows:

4.1 Start game: Nine Gongge show the topic;

4.2 Pause the game: Cover the topic with a separate drawn Label (hidelabel.visible = true;);

4.3 Continue the game: Hide the Label used to cover the topic;

4.4 End Game: Nine Gongge all Textbox emptied.

5. After clicking the "Start Game" button, the button text changes to "pause the game", then each time you click this button, the text will appear as "continue game" and "Pause the game", plus "Stop game" button.

Here you need to call the corresponding code in the Button_Click () event based on the different button text, Resharper the If ... Else If ... Else statement to replace the Switch statement, suddenly think of two kinds of statements which is an efficient problem, so on the StackOverflow to find such a discussion post, according to the content of the discussion, for judging conditions only three different values, whether using the IF statement or Switch The statement is completely no problem, haha.

Reference link: What are quicker, switch on string or ElseIf on type? (The discussion is very exciting)

The current game interface:

C # program Two-Sudoku mini-game (1. UI design)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.