Possible Duplicate:
How can I change listbox item’s visibility property in wp7?
Could you help me toggle the visibility of a listbox with a button?
This is what I have:
private void button3_Click(object sender, RoutedEventArgs e)
{
listbox1.Visibility = Visibility.Visible;
if (listbox1.Visibility = Visibility.Collapsed) ;
{
Visibility.Visible = true;
}
}
This will do the job though not as concise as scartag’s answer , SilverLight and WPF have the Visibility property now, gone are the days of using a bool to set visibility.