WPF中GridSplitter控件的使用
先看一下效果,左边是一个树形列表,右边是选中后的说明。
实现起来也很简单:
<Grid Margin="0,32,0,28" Name="gridMain" Loaded="TreeViewItem_Loaded">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="70*"/>
<ColumnDefinition Width="30*"/>
</Grid.ColumnDefinitions>
<GridSplitter Width="5" Loaded="TreeViewItem_Loaded"></GridSplitter>
<TreeView FontSize="14" Grid.Row="0" Grid.Column="0" Margin="0,0,5,0" Name="trvList" Loaded="TreeViewItem_Loaded">
</TreeView>
<Label Background="LightGreen" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Grid.Row="0" Grid.Column="1" Loaded="TreeViewItem_Loaded" />
</Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="70*"/>
<ColumnDefinition Width="30*"/>
</Grid.ColumnDefinitions>
<GridSplitter Width="5" Loaded="TreeViewItem_Loaded"></GridSplitter>
<TreeView FontSize="14" Grid.Row="0" Grid.Column="0" Margin="0,0,5,0" Name="trvList" Loaded="TreeViewItem_Loaded">
</TreeView>
<Label Background="LightGreen" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Grid.Row="0" Grid.Column="1" Loaded="TreeViewItem_Loaded" />
</Grid>
作者:行一山人
出处:http://www.cnblogs.com/benbenkoala/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。