-->

Thursday, July 31, 2014

How to add item into the listBox in windows phone

How to add item into the listBox in windows phone


ListBox is a container in which we can add strings. User can select by clicking. Article contain different topics , these are
 1. Add ListBox Control with items using XAML
 2. Add ListBox Control in code file


There are some basic steps to complete that tasks
Add ListBox control with items using XAML
Step-1 :  Add ListBox control in contentPanel using xaml code , now your code llok like
<ListBox x:Name=" ListBox1" >
 </ListBox>
Step-2 :  Open ListBox properties and select Items(collection) ellipse symbol. After pressing ellipse button , A new window will appear
Open ListBox properties and select Items

Step-3 :  Using Object Collection Editor, add controls to the List Box by selecting controls from Dropdown List.
Object Collection Editor


Step-4  : After adding controls, you can assign content property of them.
Step-5 : Now, Press Ok button after adding items.
Step-6 : Now , Your complete code look like

<ListBox x:Name=" L1" >
                <ListBoxItem Content="Apple"/>
                <ListBoxItem Content="Mango"/>
                <CheckBox Content="Male" IsChecked="True"/>

            </ListBox>

Code Generate the following output

How to add item into the listBox in windows phone

Read other related articles

Also read other articles

© Copyright 2013 Computer Programming | All Right Reserved