DockPanel为容器控件.主要了解其Dock属性和LastChildFill属性的使用

下面以代码示例

1.
wpf学习笔记---DockPanel<DockPanel LastChildFill="True">
wpf学习笔记---DockPanel    
<Button DockPanel.Dock="Top">Top</Button>
wpf学习笔记---DockPanel    
<Button DockPanel.Dock="Bottom">Bottom</Button>
wpf学习笔记---DockPanel    
<Button DockPanel.Dock="Left">Left</Button>
wpf学习笔记---DockPanel    
<Button DockPanel.Dock="Right">Right</Button>
wpf学习笔记---DockPanel    
<Button>Fill</Button>
wpf学习笔记---DockPanel
</DockPanel>
wpf学习笔记---DockPanel
wpf学习笔记---DockPanel

wpf学习笔记---DockPanel

2.调整顺序后的变化

wpf学习笔记---DockPanel<DockPanel LastChildFill="True">
wpf学习笔记---DockPanel    
<Button DockPanel.Dock="Left">Left</Button>
wpf学习笔记---DockPanel    
<Button DockPanel.Dock="Right">Right</Button>
wpf学习笔记---DockPanel    
<Button DockPanel.Dock="Top">Top</Button>
wpf学习笔记---DockPanel    
<Button DockPanel.Dock="Bottom">Bottom</Button>
wpf学习笔记---DockPanel    
<Button>Fill</Button>
wpf学习笔记---DockPanel
</DockPanel>
wpf学习笔记---DockPanel

wpf学习笔记---DockPanel

3.当LastChildFill属性为Flase时的变化

wpf学习笔记---DockPanel  <DockPanel LastChildFill="False">
wpf学习笔记---DockPanel    
<Button DockPanel.Dock="Left">Left</Button>
wpf学习笔记---DockPanel    
<Button DockPanel.Dock="Right">Right</Button>
wpf学习笔记---DockPanel    
<Button DockPanel.Dock="Top">Top</Button>
wpf学习笔记---DockPanel    
<Button DockPanel.Dock="Bottom">Bottom</Button>
wpf学习笔记---DockPanel    
<Button>Fill</Button>
wpf学习笔记---DockPanel  
</DockPanel>

wpf学习笔记---DockPanel

结束

相关文章:

  • 2021-08-22
  • 2021-05-25
  • 2021-07-01
  • 2021-11-13
  • 2021-11-20
  • 2022-01-30
  • 2021-08-06
  • 2021-09-23
猜你喜欢
  • 2021-05-30
  • 2021-10-31
  • 2021-09-16
  • 2021-06-08
  • 2021-06-08
  • 2022-12-23
相关资源
相似解决方案