Aligning controls on both left and right side in a stack panel in WPF

后端 未结 4 1648
梦谈多话
梦谈多话 2020-12-29 19:24

I have the following code:


    
        

        
4条回答
  •  一个人的身影
    2020-12-29 20:00

    As you have set the StackPanel's orientation to Horizontal, the HorizontalAlignment property won't work on child-elements. You can keep the StackPanel if you need additional controls, though I would recommend switching to a Grid (among other things) to build the layout you want.

    Also, the Grid will allow you to control the actual width of each column:

    
        
            
            
        
    
        
    
        
    

提交回复
热议问题