Click here to Skip to main content
14,873,563 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
My program is to Delete the items in Listbox, when the user clicks DELETE button Checkbox will appear inside listbox items. then user will select checkbox which one to be delete from list..

How can do coding for this ??

What I have tried:

<pre> <ListBox x:Name="ListBox_PhoneNumber" Margin="235,39,102,0" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="1" Grid.RowSpan="3" FontSize="13" FontWeight="Bold">
          <Style TargetType="ListBoxItem">
              <Setter Property="OverridesDefaultStyle" Value="true" />
              <Setter Property="SnapsToDevicePixels" Value="true" />
              <Setter Property="Template">
       <ControlTemplate TargetType="ListBoxItem">
    <CheckBox Margin="5,2" x:Name="Chk_Listbox" IsChecked="{TemplateBinding IsSelected}">
  <ContentPresenter />
<Button Style="{StaticResource ButtonTopBar}" Content="Delete" x:Name="Button_DltSOTA_Authen" HorizontalAlignment="Right" Width="100" Grid.Column="3" Grid.Row="4" FontSize="14" VerticalAlignment="Bottom" Margin="0,0,49,85" Click="Button_DltSOTA_Authen_Click_1" />
Gerry Schmitz 19-Dec-19 11:20am
The checkbox in redundant: select one or more items, press delete button, delete "selected" items.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900