Horizontal ListBox Items Stretching

前端 未结 2 1246
陌清茗
陌清茗 2021-01-23 17:08

I have a problem with my ListBox in WPF. First of all, I have a horizontal ListBox with custom ItemTemplate. Now, I want to stretch the items, so that the items fits over the co

2条回答
  •  Happy的楠姐
    2021-01-23 17:13

    Instead of using StackPanel use UniformGrid

    Provides a way to arrange content in a grid where all the cells in the grid have the same size.

    and bind number of columns to number of items in the list and disable horizontal scrolling functionality.

    
       
          
             
          
       
       
          
       
    
    

提交回复
热议问题