Xceed Grid for WinForms v4.3 Documentation
Welcome to Xceed Grid for WinForms v4.3 / Sample applications / Puzzle Sample Application
In This Topic
    Puzzle Sample Application
    In This Topic

    Programming languages

    VB.NET, C#

    Overview

    This sample extends the row and cell classes to display an image and allows you to play a puzzle game.

    Demonstrates

    • Binding the grid to a jagged array containing user provided data 

    • Extending the DataCell class (look in the ImageCell class) 

    • Extending the DataRow class (look in the ImageRow class)

    How to use

    Hit the "Scramble" button to scramble the puzzle. At any given moment, 4 cells have the focus. Hitting the space bar will rotate (clockwise) the images in each cell. Use the arrow keys to change the cells with the focus. Try to unscramble the picture of the cats. 

    You can change the picture by using the "Image…" button. Moving the "Scramble level" slider to the right just scrambles the blocks more when you hit the "Scramble" button. 

    By default, the game is a 4x4 grid. To make it more difficult, change the "HorizontalImages = 4" line of code at the end of the Puzzles.cs or Puzzles.vb file to a number higher than 4.

    Project location & filename

    C#: Xceed Samples\Xceed Grid for WinForms v#.#\CSharp\Puzzle\PuzzleCS.csproj

    VB.NET: Xceed Samples\Xceed Grid for WinForms v#.#\Visual Basic .NET\Puzzle\PuzzleVB.vbproj