Tic-Tac-Toe Game RRS feed

  • Question

  • Hi There.

    I am creating a Tic-Tac-Toe game in Windows 8. It should have two players. Player 1 is x by default. Instead of using buttons, I am using 9 blank images. I want that if a user clicks on the desired image, an X should appear. I also have designed the X and O image files. Can anyone help me on how to go about coding this.


    Monday, October 21, 2013 7:44 AM


  • Assuming you XAML for the image control looks something like this:

    <Image x:Name="Row0Column1" Width="200" Source="Images/myimage.png" />

    In you code behind you can set the images source property to a new image as follows:

    Row0Column1.Source = "Images/xImage.png";

    Bret Bentzinger (MSFT) @awehellyeah

    Monday, October 21, 2013 8:06 PM