zoukankan
html css js c++ java
继续聊WPF——Expander控件(1)
欢迎加入.NET技术交流群:189931386
Expander是一个可以展开和折叠的控件,它包含两部分——标头和内容。
标头通Header属性来设置,内容通过Conent属性设置,如下面一个简单的例子:
<Expander ExpandDirection="Down" Width="96"> <Expander.Header> <TextBlock Text="标题" FontWeight="Bold"/> </Expander.Header> <Expander.Content> <TextBlock TextWrapping="Wrap" Text="这里是内容。"/> </Expander.Content> </Expander>
Expander控件的Header和Content都可以为任何对象,只要能正常显示即可。
下面就是该控件运行时的截图。
这个控件最实用的地方,就是做导航栏。
<StackPanel Margin="20,20" Width="100" Height="460" HorizontalAlignment="Left" VerticalAlignment="Top"> <Expander VerticalAlignment="Stretch" ExpandDirection="Down" HorizontalContentAlignment="Left" SnapsToDevicePixels="True"> <Expander.Header> <TextBlock Text="用户管理" FontSize="14" FontWeight="Bold" /> </Expander.Header> <Expander.Content> <Grid> <Grid.RowDefinitions> <RowDefinition Height="auto"/> <RowDefinition Height="auto"/> </Grid.RowDefinitions> <RadioButton Grid.Row="0">会员管理</RadioButton> <RadioButton Grid.Row="1">角色管理</RadioButton> </Grid> </Expander.Content> </Expander> <Expander VerticalAlignment="Stretch" ExpandDirection="Down" HorizontalContentAlignment="Left" SnapsToDevicePixels="True"> <Expander.Header> <TextBlock Text="文档管理" FontSize="14" FontWeight="Bold" /> </Expander.Header> <Expander.Content> <Grid> <Grid.RowDefinitions> <RowDefinition Height="auto"/> <RowDefinition Height="auto"/> <RowDefinition Height="auto"/> </Grid.RowDefinitions> <RadioButton Grid.Row="0">部门资料</RadioButton> <RadioButton Grid.Row="1">员工资料</RadioButton> <RadioButton Grid.Row="2">职位资料</RadioButton> </Grid> </Expander.Content> </Expander> <Expander VerticalAlignment="Stretch" ExpandDirection="Down" HorizontalContentAlignment="Left" SnapsToDevicePixels="True"> <Expander.Header> <TextBlock Text="采购管理" FontSize="14" FontWeight="Bold" /> </Expander.Header> <Expander.Content> <Grid> <Grid.RowDefinitions> <RowDefinition Height="auto"/> <RowDefinition Height="auto"/> <RowDefinition Height="auto"/> <RowDefinition Height="auto"/> <RowDefinition Height="auto"/> </Grid.RowDefinitions> <RadioButton Grid.Row="0">采购计划</RadioButton> <RadioButton Grid.Row="1">需求分析</RadioButton> <RadioButton Grid.Row="2">采购单</RadioButton> <RadioButton Grid.Row="3">入库验收</RadioButton> <RadioButton Grid.Row="4">入库退回</RadioButton> </Grid> </Expander.Content> </Expander> <Expander VerticalAlignment="Stretch" ExpandDirection="Down" HorizontalContentAlignment="Left" SnapsToDevicePixels="True"> <Expander.Header> <TextBlock Text="供应商" FontSize="14" FontWeight="Bold" /> </Expander.Header> <Expander.Content> <Grid> <Grid.RowDefinitions> <RowDefinition Height="auto"/> <RowDefinition Height="auto"/> <RowDefinition Height="auto"/> </Grid.RowDefinitions> <RadioButton Grid.Row="0">基本资料</RadioButton> <RadioButton Grid.Row="1">往来单位</RadioButton> <RadioButton Grid.Row="2">上游供应商</RadioButton> </Grid> </Expander.Content> </Expander> </StackPanel>
另外,通过ExpandDirection属性可控其展开的方向。
<Expander VerticalAlignment="Stretch" ExpandDirection="Right" HorizontalContentAlignment="Left" SnapsToDevicePixels="True"> ............ </Expander>
查看全文
相关阅读:
NGINX_深度优化实践
NFS服务端___NFS客户端
NFS 批量管理 分发
MYSQL---数据备份与还原
MYSQL---建立字符集数据库
MYSQL---基于mysql多实例数据库创建主从复制
MYSQL---关于MYSQL优化
bug记录-left jion连接后不是一对一情况时,记得去重
bug记录-不等于某个值,查询后注意不包括为空的情况(由于NULL不能直接用算术运算符进行比较值。要想把为NULL 的那行也查询出来的话,只能使用IS NULL)
bug记录-sqljion连接 like
原文地址:https://www.cnblogs.com/javawebsoa/p/2457973.html
最新文章
python中字典的循环遍历的两种方式
给Python初学者的一些编程建议
python类学习以及mro--多继承属性查找机制
Python新式类和经典类的区别
Python globals() locals() vars() 三个内建函数的区别
python中locals和globals函数
Python两个内置函数——locals 和globals (学习笔记)
Python中的模块
114.django复制模型对象和自定义字段
113.java基础22(java12&13新特性回顾)
热门文章
112.java基础21(java11新特性回顾)
111.java基础20(java8新特性回顾)
110.dd命令
109.linux标椎输入和标准输出
108.linux服务器时区问题,导致数据库和django项目不能启动
107.django日志bug
103.文件编码转换
PHP---php安装编译参数详解
PHP---编译安装PHP
Nginx配置和内核优化 实现突破十万并发
Copyright © 2011-2022 走看看