How to change Background and Foreground of a TextBlock when is swapped? RRS feed

  • Question

  • Hi,
    In Store is an app made by Microsoft named Wordament.
    To start the app 4 letters(TextBlocks) P L A Y are used.
    If tapped First and Last letter the Background and Foreground
    change at all 4 and app starts.
    If First is tapped and swepped?? over the next 3 the Background and Foreground
    change at all 4 and app starts.

    Any idea how is done please?

    With phone 7.1 tried see code but in Store Windows 8.1 no MouseLeftButtonDown

      <Canvas Height="50" HorizontalAlignment="Left" m
                        Margin="0,0,0,0" Name="gBoard"
                        VerticalAlignment="Top" Width="200" 
                <TextBlock Text="B"
                           Name="tb_00"  Width="50" Height="50"
                           FontWeight="Bold" Canvas.Left="0"
                           Style="{StaticResource GamePiece}"
                <TextBlock Text="L" Name="tb_01"  Height="50"
                           Width="50" FontWeight="Bold"
                           Canvas.Left="50" Canvas.Top="0"
                           Style="{StaticResource GamePiece}"
                <TextBlock Text="U" Name="tb_02"  Width="50"
                           Height="50" FontWeight="Bold"
                           Canvas.Left="100" Canvas.Top="0" 
                           Style="{StaticResource GamePiece}"
                <TextBlock Text="E" Name="tb_03"  Width="50"
                           Height="50" FontWeight="Bold"
                           Canvas.Left="150" Canvas.Top="0"
                           Style="{StaticResource GamePiece}"



    • Edited by adibu Friday, February 14, 2014 1:34 AM Erorr
    Friday, February 14, 2014 12:27 AM

All replies

  • I'm not sure exactly what effect you are looking for here, but in Windows Store apps you use Pointer events to handle touch, mouse, and stylus input. See Quickstart: Pointers
    • Marked as answer by Anne Jing Friday, February 21, 2014 3:30 AM
    • Unmarked as answer by adibu Friday, February 21, 2014 4:17 PM
    Friday, February 14, 2014 1:34 AM