0

I need to set Height,Width and Border Color for Each list items in the Listbox. In the event that I set Setter Property it's setting for entire listbox. Be that as it may, I need to set every last rundown thing. Any one help me.

here's my code:

  <ListBox x:Name="lbOne" PreviewMouseLeftButtonDown="ListBox_PreviewMouseLeftButtonDown"
             HorizontalAlignment="Left" Margin="12,29,0,12" Width="215"  
             ScrollViewer.VerticalScrollBarVisibility="Visible" /> 
Raj De Inno
  • 1,092
  • 2
  • 14
  • 33

1 Answers1

0

Try the following piece of code and let me know if it works for you.

<ListBox ...>
<ListBox.ItemContainerStyle>
    <Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}">
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
    </Style>
</ListBox.ItemContainerStyle>

Also, please refer the followings link for reference.

Probably, refer to the below link for using the ListBox Item properties appropriately.

Community
  • 1
  • 1
TheGaME
  • 443
  • 2
  • 8
  • 21