当前位置:网站首页>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>
效果
边栏推荐
猜你喜欢
[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
XAML WPF项目groupBox控件
Ali's official Redis development specification
GRUB2的零日漏洞补丁现已推出
SQL窗口函数
酷逼了 Pathetic Dog 第 304 场周赛
一加OnePlus 10RT出现在Geekbench上 产品发布似乎也已临近
【R语言】对图片进行裁剪 图片批量裁剪
[供应链·案例篇]石油和天然气行业的数字化转型用例
Detailed explanation of the working principle of crystal oscillator
随机推荐
参观首钢园
关于Mysql服务无法启动的问题
缓存一致性MESI与内存屏障
08 Spark cluster construction
基于ORB-SLAM2的改进代码
面经汇总-社招-6年
C# LibUsbDotNet 在USB-CDC设备的上位机应用
My new book has sold 10,000 copies!
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!
[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
广汽埃安“弹匣电池”,四大核心技术,出行安全保障
统信软件、龙芯中科等四家企业共同发布《数字办公安全创新方案》
hcip第九天
C语言理论--笔试面试基础稳固
Good guy, the company server just crashed!
04 flink cluster construction
XAML WPF项目groupBox控件
块级元素、行内元素、行内块元素
指针和解引用
食品安全 | 新鲜食品vs速食食品,哪一种是你的菜?