|
-
October 22nd, 2011, 04:45 AM
#1
Make textblock show text according to listbox item
Hello!
I'm trying to make a listbox in C# (WP7 development) that will show text in a textblock according to which listbox item that has been selected.
So basically, it's like this (an example I made up now):
listBox1:
Energy Drink
Food
textBlock1:
(no text)
However, I want to update the textBlock1 with "Energy Drink might not be good for your health" when the listbox item "Energy Drink" is selected, and then another text if the "Food" item is selected.
I'm trying to do this with an "else IF", but it doesn't seem to be working, as no text is put into the textblock when an item is selected (in WP7 emulator mode).
Anyone got any good ideas for this? I've been searching for a maniac for this, and I found the ListBox.SelectedItem property @ Microsoft, but I don't even get that to work (http://msdn.microsoft.com/en-us/libr...ecteditem.aspx).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|