当前位置: 首页 > wzjs >正文

网站建设售后协议小网站广告投放

网站建设售后协议,小网站广告投放,投资公司投资项目流程,河东苏州网站建设C# WPF编程-TabControl 布局:代码:效果 WPF中的TabControl是一个非常灵活和强大的控件,用于在一组页面或选项卡之间进行导航。每个选项卡(TabItem)可以包含任意复杂的UI内容。接下来,我将介绍如何使用TabCo…

C# WPF编程-TabControl

  • 布局:
  • 代码:
  • 效果

WPF中的TabControl是一个非常灵活和强大的控件,用于在一组页面或选项卡之间进行导航。每个选项卡(TabItem)可以包含任意复杂的UI内容。接下来,我将介绍如何使用TabControl,包括基本用法、样式定制以及如何实现垂直标签布局。

  • TabControl : 添加选项卡控件
  • TabItem:添加选项卡页面

布局:

<Window x:Class="WpfBaseDemo.WindowTabctrolDemo"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:WpfBaseDemo"mc:Ignorable="d"Title="WindowTabctrolDemo" Height="450" Width="800"><Window.Resources><Style x:Key="TabItemHeaderTextStyle"><Setter Property="TextBlock.FontSize" Value="15"/><Setter Property="TextBlock.FontStyle" Value="Italic"/><Setter Property="TextBlock.FontWeight" Value="Bold"/><Setter Property="TextBlock.Foreground" Value="#FF00479D"/></Style></Window.Resources><Grid><Grid.RowDefinitions><RowDefinition/></Grid.RowDefinitions><Grid.ColumnDefinitions><ColumnDefinition/><ColumnDefinition/></Grid.ColumnDefinitions><TabControl Grid.Row="0" Grid.Column="0" SelectionChanged="TabControl_SelectionChanged"><TabItem Header="第一页"><Grid><Grid.RowDefinitions><RowDefinition/><RowDefinition/></Grid.RowDefinitions><Grid.ColumnDefinitions><ColumnDefinition/><ColumnDefinition/></Grid.ColumnDefinitions><!-- 日历 --><Calendar Grid.Row="0" Grid.Column="0"/><Slider Grid.Row="0" Grid.Column="1" Value="50" Maximum="100"/></Grid></TabItem><TabItem Header="第二页"></TabItem><TabItem Header="第三页"></TabItem></TabControl><TabControl Grid.Row="0" Grid.Column="1" ><TabItem><TabItem.Header><StackPanel Orientation="Horizontal"><Image Source="Images/mail-send.png"/><TextBlock Text="第一页" Style="{StaticResource TabItemHeaderTextStyle}"/></StackPanel></TabItem.Header></TabItem><TabItem><TabItem.Header><StackPanel Orientation="Horizontal"><Image Source="Images/help-contents.png"/><Label Content="第二页" Style="{StaticResource TabItemHeaderTextStyle}"/></StackPanel></TabItem.Header></TabItem><TabItem><TabItem.Header><StackPanel Orientation="Horizontal"><Image Source="Images/stock_text_center.png"/><Label Content="第三页" Style="{StaticResource TabItemHeaderTextStyle}" /></StackPanel></TabItem.Header><StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"><Rectangle Width="200" Height="200"><Rectangle.Fill><SolidColorBrush Color="Gold"/></Rectangle.Fill></Rectangle></StackPanel></TabItem></TabControl></Grid>
</Window>

代码:

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;namespace WpfBaseDemo
{/// <summary>/// WindowTabctrolDemo.xaml 的交互逻辑/// </summary>public partial class WindowTabctrolDemo : Window{public WindowTabctrolDemo(){InitializeComponent();}private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e){TabControl? tabControl = sender as TabControl;if (tabControl != null) {switch (tabControl.SelectedIndex){case 0:Debug.WriteLine("第一页");break;case 1:Debug.WriteLine("第二页");break;case 2:Debug.WriteLine("第三页");break;default:break;}                }           }}
}

效果

在这里插入图片描述

http://www.dtcms.com/wzjs/508096.html

相关文章:

  • 网站几种颜色新品推广策划方案
  • 龙华做网站哪家便宜上海网络营销
  • 美国网站加速器wordpress
  • 做网站分期付款比例百度云
  • 网站开发服务外包合同企业邮箱登录入口
  • 怎样在手机上面建设网站如何制作一个个人网站
  • 商业网站建设案例课程百度云杭州seo薪资水平
  • 深圳惠州网站建设合肥百度推广公司哪家好
  • 有没有网站学做总结泰安网站seo推广
  • 深圳龙岗网站建设哪家好公司网络游戏推广怎么做
  • 免费微网站怎么做百度指数属于行业趋势及人群
  • 怎么配置网站服务器深圳网站建设找哪家公司好
  • 点击最多的网站bt磁力搜索器
  • 个人网站不能有盈利性质友情链接出售
  • 武汉网站建设网站推广seo流量是什么
  • 韩国做美食的视频网站赵阳竞价培训
  • 江苏建设工程招标网官方网站网站免费搭建平台
  • 有哪些企业可以做招聘的网站有哪些内容百度推广怎么弄
  • 免费网站制作app上海seo关键词优化
  • 网站建设业务需求文档刚刚中国宣布重大消息
  • 做网站技术选择什么软件引流客源最快
  • 网站一般宽度重庆森林经典台词梁朝伟
  • 网站内容做淘宝店铺链接影响排名吗数据分析工具
  • 网站建设需要经过哪几个步骤怎么制作网站?
  • 找单位做网站需要注意什么合肥关键词排名
  • 有什么可以做兼职的正规网站广州优化公司哪家好
  • 无锡做网站的公司seo关键词排名优化怎么收费
  • 网站建站素材网络推广哪个平台好
  • 自动化的网站建设如何创建自己的网址
  • 沧州自适应网站建设网站制作的流程