How to use DockStyle.Fill for standard controls in WPF?

后端 未结 4 1829
醉梦人生
醉梦人生 2021-01-29 22:17

I\'m used from windows forms, that I create a panel, place controls inside it and give them DockStyle.Fill to max out their size to the surrounding panel.

I

4条回答
  •  面向向阳花
    2021-01-29 22:42

    You can do what you want by just saying DockPanel LastChildFill="True" and then making sure what you want to be the filler is actually the last child!

    The Grid is the beast of a layout that you can make do most anything, but the DockPanel is usually the right choice for your outermost layout panel. Here is an psuedocode example:

    
        
        
    
        
    
    

提交回复
热议问题