这个控件最实用的地方,就是做导航栏。

  1. <StackPanel Margin="20,20" Width="100" Height="460" HorizontalAlignment="Left"
  2. VerticalAlignment="Top">
  3. <Expander VerticalAlignment="Stretch" ExpandDirection="Down" HorizontalContentAlignment="Left" SnapsToDevicePixels="True">
  4. <Expander.Header>
  5. <TextBlock Text="用户管理" FontSize="14" FontWeight="Bold" />
  6. </Expander.Header>
  7. <Expander.Content>
  8. <Grid>
  9. <Grid.RowDefinitions>
  10. <RowDefinition Height="auto"/>
  11. <RowDefinition Height="auto"/>
  12. </Grid.RowDefinitions>
  13. <RadioButton Grid.Row="0">会员管理</RadioButton>
  14. <RadioButton Grid.Row="1">角色管理</RadioButton>
  15. </Grid>
  16. </Expander.Content>
  17. </Expander>
  18. <Expander VerticalAlignment="Stretch" ExpandDirection="Down" HorizontalContentAlignment="Left" SnapsToDevicePixels="True">
  19. <Expander.Header>
  20. <TextBlock Text="文档管理" FontSize="14" FontWeight="Bold" />
  21. </Expander.Header>
  22. <Expander.Content>
  23. <Grid>
  24. <Grid.RowDefinitions>
  25. <RowDefinition Height="auto"/>
  26. <RowDefinition Height="auto"/>
  27. <RowDefinition Height="auto"/>
  28. </Grid.RowDefinitions>
  29. <RadioButton Grid.Row="0">部门资料</RadioButton>
  30. <RadioButton Grid.Row="1">员工资料</RadioButton>
  31. <RadioButton Grid.Row="2">职位资料</RadioButton>
  32. </Grid>
  33. </Expander.Content>
  34. </Expander>
  35. <Expander VerticalAlignment="Stretch" ExpandDirection="Down" HorizontalContentAlignment="Left" SnapsToDevicePixels="True">
  36. <Expander.Header>
  37. <TextBlock Text="采购管理" FontSize="14" FontWeight="Bold" />
  38. </Expander.Header>
  39. <Expander.Content>
  40. <Grid>
  41. <Grid.RowDefinitions>
  42. <RowDefinition Height="auto"/>
  43. <RowDefinition Height="auto"/>
  44. <RowDefinition Height="auto"/>
  45. <RowDefinition Height="auto"/>
  46. <RowDefinition Height="auto"/>
  47. </Grid.RowDefinitions>
  48. <RadioButton Grid.Row="0">采购计划</RadioButton>
  49. <RadioButton Grid.Row="1">需求分析</RadioButton>
  50. <RadioButton Grid.Row="2">采购单</RadioButton>
  51. <RadioButton Grid.Row="3">入库验收</RadioButton>
  52. <RadioButton Grid.Row="4">入库退回</RadioButton>
  53. </Grid>
  54. </Expander.Content>
  55. </Expander>
  56. <Expander VerticalAlignment="Stretch" ExpandDirection="Down" HorizontalContentAlignment="Left" SnapsToDevicePixels="True">
  57. <Expander.Header>
  58. <TextBlock Text="供应商" FontSize="14" FontWeight="Bold" />
  59. </Expander.Header>
  60. <Expander.Content>
  61. <Grid>
  62. <Grid.RowDefinitions>
  63. <RowDefinition Height="auto"/>
  64. <RowDefinition Height="auto"/>
  65. <RowDefinition Height="auto"/>
  66. </Grid.RowDefinitions>
  67. <RadioButton Grid.Row="0">基本资料</RadioButton>
  68. <RadioButton Grid.Row="1">往来单位</RadioButton>
  69. <RadioButton Grid.Row="2">上游供应商</RadioButton>
  70. </Grid>
  71. </Expander.Content>
  72. </Expander>
  73. </StackPanel>

另外,通过ExpandDirection属性可控其展开的方向。

  1. <Expander VerticalAlignment="Stretch" ExpandDirection="Right" HorizontalContentAlignment="Left" SnapsToDevicePixels="True">
  2. ............
  3. </Expander>

转载于:https://www.cnblogs.com/xieweikai/p/6832754.html

继续聊WPF——Expander控件(1)相关推荐

  1. WPF Expander控件简单样式

    WPF Expander控件简单样式 样式代码: <Style x:Key="ExpanderStyle1" TargetType="{x:Type Expande ...

  2. WPF Expander控件使用

    WPF Expander控件使用 xaml代码: <Window x:Class="WpfApp5.MainWindow"xmlns="http://schemas ...

  3. WPF——Expander控件(转)

    Expander是一个可以展开和折叠的控件,它包含两部分标头和内容. 标头通Header属性来设置,内容通过Conent属性设置,如下面一个简单的例子: Expander ExpandDirectio ...

  4. 继续聊WPF——Slider控件

    Slider控件,讲行通俗一点就是我们很常见的滑块,控件的外观上显示一系例刻度值,并存在一个可以被拖动的滑块,用户可以通过拖动滑块来控制控件的值. 如下图所示,是Windows系统的音量调节滑块. 下 ...

  5. slider wpf 垂直_继续聊WPF——Slider控件

    下面看一个Tick控件的例子,这只是演示,Tick单独使用没有意义. Minimum="0" Fill="DarkMagenta" Placement=&quo ...

  6. C# wpf Expander控件的简单应用(7)

    测试 可以通过ExpandDirection属性可控制其展开方向.

  7. expander菜单控件_《WPF》Expander控件简单美化

    示例图: Expander控件功能很常见, 一般用于系统左侧的菜单收缩面板. 1.主要的组成 一个头部(header) 和 一个 内容(content) 组成. 控制中心 资源管理 仪表菜单 顶部导航 ...

  8. WPF 控件专题 Expander控件详解

    1.Expander介绍 Expander控件显示具有可折叠内容显示窗口的标题.是一个可以展开和折叠的控件,它包含两部分--标头和内容. 控件不会自动提供 Expander 滚动功能:如果展开窗口的内 ...

  9. 2021-08-11 WPF控件专题 Expander 控件详解

    1.Expander 控件介绍 折叠控件 GroupBox 带标题 HeaderedContentControl 折叠或展开的特点,IsExpand 是否显示内容,默认False (隐藏的) Expa ...

  10. 2021-08-19 WPF控件专题 Expander 控件详解

    1.Expander 控件介绍 折叠控件 GroupBox 带标题 HeaderedContentControl 折叠或展开的特点,IsExpand 是否显示内容,默认False (隐藏的) Expa ...

最新文章

  1. MongoDB的安装及基本命令和pymongo的使用
  2. centos cmake安装mysql_Centos安装mysql实例教程
  3. 小程序支付成功后跳转页面失败
  4. 阿里巴巴右侧6滑块VS雅虎右侧6滑块VS自定义6滑块
  5. linus系统下载_系统管理程序卷土重来,Linus拒绝并阅读电子邮件,以及更多行业趋势
  6. 多浏览器判断,切换及使用
  7. 组策略:交互式登录:不显示最后的用户名
  8. 2021想学UI设计,你必需要知道这些
  9. c语言界面飞机图形代码,求个用最简单的的代码来实现图形界面…
  10. 《大道至简》第一章读后感(java伪代码)
  11. 如何布局电子商务网站
  12. rust相框加载图片代码_vue图片加载与显示默认图片实例代码
  13. 无法查看别的计算机,雨林木风win7网上邻居看不到别的电脑的解决教程
  14. ubuntu20安装gcc_Ubuntu:软件常用安装方法(附WPS安装)
  15. 计算机类综合素质测评考什么,综合素质测试考什么内容
  16. 数组——二维数组及字符串
  17. 工业控制计算机系统总线,工业控制计算机总线技术.ppt
  18. 干货:Hulu教你赴美工作怎么拿签证!
  19. [chat-GPT]解决OpenAI‘s services are not available in your country问题
  20. java layout组件居中_Android 布局中 如何使控件居中

热门文章

  1. libx264.c:function X264_init: error: undefined reference to x264_encoder_open_142
  2. LINUX下载编译libvpx
  3. 编译问题解决:mkdir: 无法创建目录/usr/local/share/man/man1: 文件已存在
  4. 热烈祝贺排名进入前1000
  5. 小腿抽筋了,按摩承山穴,外加念观世音菩萨是不是迷信
  6. 检验成果的软指标与硬指标
  7. 一个简单进程池的实现
  8. 包打包和解析过程 unity_Unity AssetBundle 解析 (一)AB包介绍与构建
  9. 以弹窗形式打开页面_“弹窗广告”肆意而为!扰民?还可能侵权!
  10. logstash对nginx日志进行解析