当前位置:网站首页>XAML WPF item groupBox control
XAML WPF item groupBox control
2022-08-01 17:35:00 【Jinan Medical Mini Program Champion】
<Window x:Class="WpfHello.Number.One.MTL.Demo.WindowGroupBox"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfHello.Number.One.MTL.Demo"
mc:Ignorable="d"
Title="WindowGroupBox" Height="450" Width="800">
<!--
1 需要注意 heard属性的使用
2 groupbox 的内容可以自由组合
3 We used a custom template ==》 Window.Resources 里面使用 ControlTemplate 自定义模板 需要制定Key The target of action needs to be specified.
-->
<!--自定义 GroupBox 控件-->
<Window.Resources>
<ControlTemplate x:Key="myGroupBox" TargetType="GroupBox">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"> </RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Border Grid.Row="0" Background="Orange">
<Label Foreground="red" FontWeight="Bold" FontSize="18">
This is a business title
</Label>
</Border>
<Border Grid.Row="0" Background="AliceBlue">
<TabItem>
<TabItem.Header>_Job Info</TabItem.Header>
<StackPanel>
<TextBlock>Select a job</TextBlock>
<ListBox Name ="job" >
<ListBoxItem IsSelected="true">Programmer</ListBoxItem>
<ListBoxItem>Tester</ListBoxItem>
<ListBoxItem>Writer</ListBoxItem>
<ListBoxItem>Manager</ListBoxItem>
</ListBox>
</StackPanel>
</TabItem>
</Border>
</Grid>
</ControlTemplate>
</Window.Resources>
<Grid>
<GroupBox Template="{StaticResource myGroupBox}">
</GroupBox>
<GroupBox Template="{StaticResource myGroupBox}">
</GroupBox>
<!--<GroupBox Header="GroupBox"/> Header="这个是groupboxbusiness title "-->
<!--<GroupBox >
--><!-- 栈面板 <StackPanel>
</StackPanel>--><!--
<GroupBox.Header>
<Label Foreground="blue">这个是groupboxbusiness title </Label>
</GroupBox.Header>
<StackPanel>
<TabControl Name="myTabControl"
TabStripPlacement="Top"
Margin="0, 0, 0, 10" Height="350"
>
<TabItem Name="PersonalInfo">
<TabItem.Header>_Personal Info</TabItem.Header>
<StackPanel>
<TextBlock>Employee</TextBlock>
<TextBlock>Select your name</TextBlock>
<ListBox Name="empName" >
<ListBoxItem IsSelected="true">Esther</ListBoxItem>
<ListBoxItem>George</ListBoxItem>
<ListBoxItem>Alan</ListBoxItem>
<ListBoxItem>Eric</ListBoxItem>
</ListBox>
</StackPanel>
</TabItem>
<TabItem>
<TabItem.Header>_Job Info</TabItem.Header>
<StackPanel>
<TextBlock>Select a job</TextBlock>
<ListBox Name ="job" >
<ListBoxItem IsSelected="true">Programmer</ListBoxItem>
<ListBoxItem>Tester</ListBoxItem>
<ListBoxItem>Writer</ListBoxItem>
<ListBoxItem>Manager</ListBoxItem>
</ListBox>
</StackPanel>
</TabItem>
<TabItem Name="Skill">
<TabItem.Header>_Skill</TabItem.Header>
<StackPanel>
<TextBlock>
Select your strongest skill
</TextBlock>
<ListBox Name="skills" >
<ListBoxItem IsSelected="true">C#</ListBoxItem>
<ListBoxItem>Visual Basic</ListBoxItem>
<ListBoxItem>.NET</ListBoxItem>
<ListBoxItem>JScript</ListBoxItem>
</ListBox>
</StackPanel>
</TabItem>
<TabItem Name="Summary" >
<TabItem.Header>Su_mmary</TabItem.Header>
<StackPanel>
<TextBlock Name="emp"/>
<TextBlock Name="ejob"/>
<TextBlock Name="eskill"/>
</StackPanel>
</TabItem>
</TabControl>
<Button Content="Show Summary" />
</StackPanel>
</GroupBox>-->
</Grid>
</Window>
效果
边栏推荐
- hcip第九天
- 2022年深圳市促进大健康产业集群高质量发展的若干措施
- SQL函数 TO_CHAR(二)
- Are online account opening commissions reliable? Is online account opening safe?
- LeetCode Week 303
- 小贝拉机器人是朋友_普渡科技召开新品发布会,新一代送餐机器人“贝拉”温暖登场...
- B001 - 基于STM32的智能生态鱼缸
- GTK修改pixmap像素,提取pixmap像素RGB值
- Ali's official Redis development specification
- 11 Publish a series as soon as it is released
猜你喜欢

zabbix部署和简单使用

The site is not found after the website is filed. You have not bound this domain name or IP to the corresponding site! The configuration file does not take effect!

千万级乘客排队系统重构&压测方案总结篇

机器学习快速入门

TCP百万并发服务器优化调参

ROS2支持技术:DDS简述

酷逼了 Pathetic Dog 第 304 场周赛
![[Dark Horse Morning Post] Hu Jun's endorsement of Wukong's financial management is suspected of fraud, which is suspected to involve 39 billion yuan; Fuling mustard responded that mustard ate toenails](/img/d7/4671b5a74317a8f87ffd36be2b34e1.jpg)
[Dark Horse Morning Post] Hu Jun's endorsement of Wukong's financial management is suspected of fraud, which is suspected to involve 39 billion yuan; Fuling mustard responded that mustard ate toenails

ROS2系列知识(7):用rqt_console查看日志logs

How can become a good architect necessary skills: painting for all the people praise the system architecture diagram?What is the secret?Quick to open this article and have a look!.
随机推荐
想做期货,农产品期货怎么炒?波动大么
个人日记
基于ORB-SLAM2的改进代码
【100个网络运维工作者必须知道的小知识!】
实现mnist手写数字识别
助推科技强国高质量发展《科创超级训练营》系列活动正式拉开帷幕
DataTable Helper Class for C#
When custom annotations implement log printing, specific fields are blocked from printing
SQL函数 TO_CHAR(二)
C# CSV format file helper class
极化微波成像概述2
TCP百万并发服务器优化调参
力扣每日一题-第45天-697. 数组的度
存储日报-数据湖架构权威指南(使用 Iceberg 和 MinIO)
11 Publish a series as soon as it is released
LeetCode Week 303
指针和解引用
FTP helper class for C#
Good guy, the company server just crashed!
2022 Strong Net Cup CTF---Strong Net Pioneer ASR wp