Tutorial: Would a matching game WinForms application

Tutorial: Would a matching game WinForms application

  • Store objects, such as icons, in a List object.
  • Explore a good foreach cycle from inside the C# otherwise a for each and every loop in the Visual Earliest so you can iterate owing to items in a listing.
  • Keep track of a good form’s county that with site parameters.
  • Make an event handler to answer situations that one can use having numerous objects.
  • Generate a timer that matters down then fires an event precisely just after immediately after becoming become.
  • Perform a visual Business project using Window Models.
  • Include and you may structure a composition function.
  • Put and you can structure labels to display.

Build your Window Forms fits games project

Towards kept region of the The newest Opportunity dialogue container, see often Graphic C# otherwise Graphic Earliest, and pick Windows Desktop computer.

Throughout the endeavor themes list, see Windows Versions App (.Websites Structure). Term the brand new function MatchingGame, right after which see Ok.

Otherwise comprehend the Window Models Software (.Internet Build) template, use the Artwork Studio Installer to put in the new .Websites desktop computer advancement workload.

Into the Carry out a separate endeavor windows, look for Windows Forms. Next select Desktop computer in the All of the enterprise versions listing.

If you don’t understand the Screen Forms Software (.Online Design) theme, you can set it up regarding the Carry out another venture window. On Perhaps not shopping for what you are searching for? content, select the Build significantly more systems and features hook.

Come across Personalize throughout the Artwork Business Installer. You will be caused to store work. Next, discover Always build brand new workload.

Graphic Facility brings a solution for the app. A simple solution was a bin for everybody of your own programs and you may records expected by the app.

Carry out a composition for the game

Click on the mode to select the Windows Forms Designer. The fresh case reads Form1.cs [Design] for C# or Form1.vb [Design] for Visual Basic. Throughout the Functions window, place next setting services.

  • Change the Text message property off Form1 so you’re able to Matching Online game. That it text appears on top of the overall game windows.

Discover the Toolbox case for the kept area of the IDE. Or even see it, pick View > Toolbox about menu bar otherwise Ctrl+Alt+X.

Pull an excellent TableLayoutPanel manage in the Containers group regarding toolbox or twice-simply click they. Lay next services into committee throughout the Characteristics screen.

Lay the fresh new BackColor possessions in order to CornflowerBlue. To accomplish set so it property, select the arrow next to the BackColor possessions. Throughout the BackColor dialog package, see Online. Regarding readily available colour names, select CornflowerBlue.

Set the fresh Pier assets in order to Fill in the dropdown listing from the choosing the high center option. This spreads the fresh new table aside so it discusses the new entire setting.

Discover triangle key regarding the top-correct place of your TableLayoutPanel to exhibit their activity diet plan. For the activity menu, pick Put Line twice to include a few more rows. Up coming find Include Column twice to add two significantly more columns.

Toward task menu, look for Edit Rows and you will Columns to open up brand new Line and you will Row Appearance screen. For each column, find the Percent choice, and then put for every column’s depth to help you 25 percent.

Find Rows throughout the list at the top of brand new screen, immediately after which place for each row’s top in order to 25 percent.

Your TableLayoutPanel happens to be a four-by-four grid with 16 just as-size of rectangular structure. This type of rows and you will articles is actually where in actuality the icons appear after.

Include and you can structure brands to show

Make certain the brand new TableLayoutPanel is chosen about mode publisher. You will want to get a hold of tableLayoutPanel1 on top of the fresh Functions windows. When it is not chosen, discover TableLayoutPanel towards the means, or discover it on the checklist at the top of this new Qualities window.

Discover the brand new arsenal, since ahead of, and you may discover the common Regulation group. Create a label control towards upper-kept cell of your own TableLayoutPanel. The fresh new term manage is now picked regarding IDE. Lay the next services because of it.

Webdings try a font off symbols you to definitely ships into Screen systems. On the coordinating game, the gamer suits pairs out-of icons. It font screens new signs to match.

In lieu of c, try additional characters in the Text assets. An enthusiastic exclamation area try a crawl, a keen uppercase N was a watch, and a comma is an effective chili pepper.

Get a hold of your https://datingranking.net/nl/secret-benefits-overzicht/ Name manage and you will backup it to a higher telephone about TableLayoutPanel. Select the Ctrl+C keys, otherwise on eating plan pub, Edit > Copy. Upcoming paste they that with Ctrl+V or Modify > Insert.

A duplicate of the very first Term appears regarding next cell of TableLayoutPanel. Paste they once again, and one Title seems on third cell. Continue pasting Label regulation until all of the structure is occupied.

Next methods

Advance to a higher class knowing how exactly to assign good random symbol to each and every identity and you will add experience handlers in order to brands.

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *