none
image visibilty on button click

    Question

  • in vs2010,silverlight4, webapplication,i made two image controls.I want to make the visibilty of one image false on button click.I wrote the coding like blow.But image is still showing.

    <Image Grid.Row="3" Height="102" HorizontalAlignment="Left" Name="logo" Stretch="Fill" VerticalAlignment="Top" Width="595" Source="/ESRI-V-10-SIL4;component/Images/77.png" Grid.RowSpan="2" />

    <Image Grid.Row="4" Height="102" HorizontalAlignment="Left" Name="logo1" Stretch="Fill" VerticalAlignment="Top" Width="595" Source="/ESRI-V-10-SIL4;component/Images/771.png" Grid.RowSpan="2" />

    Private Sub LnkTracking_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles LnkTracking.Click
           logo.Visibility = False
            logo1.Visibility = True
        End Sub

    this code is not working.can anybdy help me?

    Sunday, May 06, 2012 10:40 AM

Answers

  • Visibility takes  Visibile or Collapsed  , not true or false. 

    Try changing that . 

            logo.Visibility = Visibility.Collapsed;
            logo1.Visibility = Visibility.Visible;

    In case you want references, here's one ... http://msdn.microsoft.com/en-us/library/system.windows.visibility%28v=vs.95%29.aspx

    Hope it Helps Laughing

    Sunday, May 06, 2012 12:04 PM