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
Step-3 : Using Object Collection Editor, add controls to the List Box by selecting controls from Dropdown List.
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>