none
ListBox

    Question

  • I have a listbox which have numbers ranging from 1 to 5 and i want to show different interface to user whenever he select a different number from listbox at runtime my question is that at runtime how to know which item is now selected and update interface based on item?
    Saturday, January 30, 2016 11:22 AM

All replies

  • private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
    	switch (ListView.SelectedIndex)
    	{
    		Case 0:
    			// Show interface 1
    			break;
    		Case 1:
    			// Show interface 2
    			break;
    		Case 2:
    			// Show interface 3
    			break;
    		Case 3:
    			// Show interface 4
    			break;
    		Case 4:
    			// Show interface 5
    			break;
    }

    Saturday, January 30, 2016 11:54 AM