none
Display image as a click event handler for windows phone RRS feed

  • Question

  • hi, I am using vs 2012 ultimate for developing windows based apps for windows phone.here I created a button and I want when I clicked on the button then to show an image but image is not showing.what can I do for this.kindly help me in this regard.   

    <controls:PivotItemHeader="   Question 1:  ">

                

    <GridHeight="600"Width="456" >


                      

                           

    <TextBlockHeight="121"HorizontalAlignment="Left"Margin="10,29,0,0"Name="textBlock1"Text="Muslims believe in how &#13;many Gods"VerticalAlignment="Top"FontSize="34"Width="436"FontFamily="Arial Black"Foreground="#FF16E9F3" />


                       

    <Buttonx:Name="btn1"Click="btn1_Click_1"HorizontalAlignment="Left"Height="87"Margin="2,394,0,0"VerticalAlignment="Top"Width="193"Foreground="#FF56AAE4"BorderThickness="5"FontFamily="Jing Jing"FontSize="32"RenderTransformOrigin="0.5,0.5"BorderBrush="Yellow">


                           

    <StackPanel>


                               

    <Imagex:Name="img"Source="/buttons/cross.png"Stretch="Fill"Margin="5,-236,101,211"Height="220"Width="348" />


                           

    </StackPanel>


                           

    <Button.Background>


                               

    <ImageBrushStretch="Fill"ImageSource="/buttons/1.png"/>


                           

    </Button.Background>


                        

                       

    </Button>


               


    Rabia (Microsoft Student Partner)

    Monday, September 2, 2013 5:45 PM

Answers

All replies

  • Make sure image path in Source  property is correct. Also your margins in control looks wrong. Probably you should use ColumnDefinitions in Grid instead of setting these high margin values.

    http://visualstudiomagazine.com/articles/2011/05/09/wcmob_layout-using-grid.aspx


    Gaurav Khanna | Microsoft VB.NET MVP | Microsoft Community Contributor

    Monday, September 2, 2013 6:17 PM
  • Hi Rabia,

    Welcome to MSDN forum.

    I think this thread is specific to WP forum. This form is to discuss problems about CLR development.

    You'll need to post it in the dedicated WP Forum http://social.msdn.microsoft.com/Forums/wpapps/en-US/home?forum=wpdevelop for more efficient responses, where you can contact WP experts.

    If you have any concerns, please don’t hesitate to let me know. I will be glad to help you again.

    Best Regards,


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, September 3, 2013 3:03 AM
    Moderator