I need Horizontal view of list boxes

后端 未结 5 643
情话喂你
情话喂你 2021-01-25 07:22

I am working on list boxes in WPF. I want to show the list boxes in horizontal direction. My code is



    

        
5条回答
  •  感动是毒
    2021-01-25 07:38

    Try a WrapPannel, which will lay the items out horizontally until there is no more room, and then move to the next line.

    You also could use a UniformGrid, which will lay the items out in a set number of rows or columns.

    The way we get the items to arange using these other panels in a ListView, ListBox, or any form of ItemsControl is by changing the ItemsPanel property. By setting the ItemsPanel you can change it from the default StackPanel that is used by ItemsControls. With the WrapPanel we also should set the widths as shown here.

    
        
            
                    
            
        
    ...
    
    

提交回复
热议问题