티스토리 뷰
http://www.wpf-tutorial.com/panels/dockpanel/
DockPanel은 4방향(좌,우,상,하)에 쉽게 도킹할 수 있으며, 마지막 요소는 나머지 공간을 채우게 됩니다.
1 2 3 4 5 6 7 | <DockPanel> <Button DockPanel.Dock="Left">Left</Button> <Button DockPanel.Dock="Top">Top</Button> <Button DockPanel.Dock="Right">Right</Button> <Button DockPanel.Dock="Bottom">Bottom</Button> <Button >Center</Button> </DockPanel> | cs |
각 버튼이 갖는 영역을 보면, 선언되어진 순서(left, top, right, bottom, center)대로 차지하는 것을 볼 수 있습니다.
이 때, 각 컨트롤의 height, width를 지정해주면 해결됩니다.
1 2 3 4 5 6 7 | <DockPanel> <Button DockPanel.Dock="Top" Height="30">Top</Button> <Button DockPanel.Dock="Bottom" Height="50">Bottom</Button> <Button DockPanel.Dock="Left" Width="40">Left</Button> <Button DockPanel.Dock="Right" Width="70">Right</Button> <Button>Center</Button> </DockPanel> | cs |
LastChildFill
마지막 자식은 나머지 공간을 차지하게 되는 것을 해결하기 위하여! LastChildFill = false 를 부여합니다.
1 2 3 4 5 6 7 8 | <DockPanel LastChildFill="False"> <Button DockPanel.Dock="Top" Height="50">Top</Button> <Button DockPanel.Dock="Bottom" Height="50">Bottom</Button> <Button DockPanel.Dock="Left" Width="50">Left</Button> <Button DockPanel.Dock="Left" Width="50">Left</Button> <Button DockPanel.Dock="Right" Width="50">Right</Button> <Button DockPanel.Dock="Right" Width="50">Right</Button> </DockPanel> | cs |
'C# > WPF' 카테고리의 다른 글
WPF tutorial - The Grid - GridSplitter, A contact form (0) | 2017.06.22 |
---|---|
WPF tutorial - The Grid(Rows&Columns, Units,Spanning) (0) | 2017.06.22 |
WPF tutorial - The StackPanel (0) | 2017.06.22 |
WPF tutorial -The WrapPanel (0) | 2017.06.22 |
WPF tutorial - The Canvas (0) | 2017.06.22 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- listview
- 그래프
- 생활코딩
- command
- CollectionView
- Fakebook
- dfs
- C++
- Add TapGesture
- 백준
- CustomCollectionViewCell
- BFS
- XAML
- 객체
- Grid
- UIView Animation
- 타일링
- MVVM
- 스택
- FEED
- 코딩야학
- 데이터 바인딩
- DP
- BOJ
- 문자열
- 백준온라인
- Custom Cell
- WPF
- Cell Animation
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함