2
Reply

List box items with icons

JOHN JOHNNNY

JOHN JOHNNNY

Feb 11 2015 4:31 AM
582
Hi
 
I have the code below which works fine for displaying listbox items i.e text,
but the challenge am having is how to add different icons for each text in the listbox for it to display different icons for each text
 
xaml
 
xaml.cs
public partial class January : PhoneApplicationPage
{
List<string> strings = new Liststring()
{ "Thursday 1st 10AM & 10PM (New Year Service), Friday 2ND 6PM, ;Sunday 4TH 10AM & 7PM , };
 

public January()
{
InitializeComponent();
 
lbx.ItemsSource = strings;
lbx.SelectionChanged += lbx_SelectionChanged;
}
 
void lbx_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
 
value = lbx.SelectedIndex;
switch (value)
{
case 0: MessageBox.Show("Morn Ist Less Isaiah 5:1-7\n\n 1 Now will I sing to my wellbeloved a song of ..........);
break;
case 1: MessageBox.Show("Ist Less Isaiah 9:1-7\n\n 1 Nevertheless the dimness shall not .................);
break;
case 2: MessageBox.Show("Morn Ist Less Psalm 146:1-10\n\n 1 Praise ye the LORD. Praise the LORD,....... );
break;
 

}
}
 
public int value { get; set; }
 
kindly help

Answers (2)