简体   繁体   中英

How to dynamically add items to ListBox in Windows Phone 7/C#

I have a ListBox defined in my app that I've populated with some static data in the XAML code. If I were to reference this ListBox in my C# code, eg

searchList.....;

What method does one use to then dynamically add items to that ListBox in your code?

Thanks in advance!

Check out the listBox.Add .

Example:

listBox1.Items.Add("Your item");

Hope it helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM