继续聊WPF——Expander控件(1)
这个控件最实用的地方,就是做导航栏。
- <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>

继续聊WPF——Expander控件(1)的更多相关文章
- 继续聊WPF——Expander控件(2)
<Window x:Class="Expander_Sample2.Window1" xmlns="http://schemas.microsoft.com/win ...
- WPF Expander控件(扩展面板)
这算是我比较喜欢的一个控件,以前在Winform中也常用类似的.它包装了一块内容,通过单击一个小箭头按钮可以显示或隐藏所包含的内容.在线帮助以及Web页面经常使用这种技术,因为既可以包含大量内容,而又 ...
- 继续聊WPF——Thumb控件
这个控件,真不好介绍,MSDN上也是草草几句,反正就是可以让用户拖动的玩意儿,但是,你会发现,当你在该控件上拖动时,它没有反响,也就是说这个东西默认不做任何操作的,它是赖在那里什么都不干,除非你去踢上 ...
- WPF中Expander控件样式,ListBox的样式(带checkbox)恢复
Expander控件样式: <ControlTemplate x:Key="ExpanderToggleButton" TargetType="ToggleButt ...
- 《WPF》Expander控件简单美化
示例图: Expander控件功能很常见, 一般用于系统左侧的菜单收缩面板. 1.主要的组成 一个头部(header) 和 一个 内容(content) 组成. <Expander Expand ...
- 迟到的 WPF 学习 —— 控件
这一章书中内容比较多而杂,但每个对象的内容又相对简短,所以只挑选里边有代表性的内容做记录. 1. Label 控件:一个基础的简单的 ContentControl,Labe 支持快捷键文本的设置,可以 ...
- 在 UWP 中实现 Expander 控件
WPF 中的 Expander 控件在 Windows 10 SDK 中并不提供,本文主要说明,如何在 UWP 中创建这样一个控件.其效果如下图: 首先,分析该控件需要的一些特性,它应该至少包括如下三 ...
- WPF Popup 控件导致被遮挡内容不刷新的原因
WPF Popup 控件导致被遮挡内容不刷新的原因 周银辉 今天在写一个WPF控件时用到了Popup控件,很郁闷的情况是:当popup关闭时,原来被popup挡住的界面部分不刷新,非要手动刷新一下(比 ...
- 创建 WPF 工具箱控件
创建 WPF 工具箱控件 WPF (Windows Presentation Framework) 工具箱控件模板允许您创建 WPF 控件,会自动添加到 工具箱 安装扩展的安装. 本主题演示如何使用模 ...
随机推荐
- ZendFramework2学习笔记 表单过滤、表单验证
ZF2有非常多内建的Filter和Validator组件,能够方便地对表单数据进行处理. Filter的作用是过滤表单数据.比如,去除一些空格,替换一些敏感词等. Validator的作用是检验表单数 ...
- 小米红米1S 电信/联通版 专用TWRP2.8.1.1中文版 (全屏触摸/支持MTP挂载内外置存储)
转载请注明出处和链接: http://blog.csdn.net/syhost/article/details/39340477 说说中文TWRP的简史: 中文TWRP是本人在201 ...
- cocos2dx编译安卓版本号查看C++错误
首先,在Mac以下相关软件路径,打开"终端",然后输入 pico .bash_profile 回车 export COCOS2DX_ROOT=/Users/bpmacmini0 ...
- HTML5开发移动web应用——SAP UI5篇(7)
SAPUI5中支持利用Component对组件进行封装.想封装一个组件,Component的基本代码例如以下: sap.ui.define([ "sap/ui/core/UIComponen ...
- null in JavaScript
C# String.IsNullOrEmpty Javascript equivalent https://stackoverflow.com/questions/5746947/c-sharp-st ...
- golomb哥伦布编码——本质上就是通过0来区分商和余数
哥伦布编码是一个针对整数的变长编码方式,详细介绍可以看维基百科.这里简单介绍下: 哥伦布编码使用指定的整数 M 把输入的整数分成两部分:商数 q.余数 r. 商数当做一元编码,而余数放在后面做为可缩短 ...
- 假脱机服务(SPOOLing service)
1. 基本含义 SPOOLing 是 Simultaneous Peripheral(外设) Operation On-Line(联机) 的缩写,是关于慢速字符设备(慢速外设,比如打印机)如何与计算机 ...
- Python 36 GIL全局解释器锁 、vs自定义互斥锁
一:GIL全局解释器锁介绍 在CPython中,全局解释器锁(或GIL)是一个互斥锁, 它阻止多个本机线程同时执行Python字节码.译文:之所以需要这个锁, 主要是因为CPython的内存管理不是线 ...
- php函数 array_values()
array_values() 函数返回一个包含给定数组中所有键值的数组,但不保留键名. 提示:被返回的数组将使用数值键,从 0 开始并以 1 递增. $a=array("Name" ...
- HTML <!DOCTYPE>标签
一般一个基本html页面的结构,如下代码所示: <html> <head> <title>我是基本的页面结构</title> </head> ...