WPF TabControl ControlTemplate [英] WPF TabControl ControlTemplate

查看:224
本文介绍了WPF TabControl ControlTemplate的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为WPF tabcontrol创建一个新的控件模板.

我遇到的情况是控件中将有许多选项卡,用户将能够添加和删除这些选项卡.

理想情况下,我想在Firefox/IE选项卡的基础上创建一些内容,从而使您可以在选项卡标题内使用删除按钮来删除当前选项卡.

而且,稍微复杂一点,我想有一个新的标签按钮,该按钮始终位于tab控件中最后一个标签的右侧.

有人能指出我的入门方向吗?我已经看到了一些使用Blend来创建新模板的人的例子.到目前为止,我还没有使用过它,只是下载了试用版...

谢谢.

解决方案

本文中(简称MVVM),作者使用控制模板来设置选项卡的样式,并带有关闭按钮等.

或者您可以使用此示例 来更基础.

I'm looking to create a new control template for a WPF tabcontrol.

The situation I have is that there will be a number of tabs in the control and the user will be able to add and delete these tabs.

Ideally I would like to create something along the lines of the Firefox / IE tabs whereby you have a delete button inside the tab heading to delete the current tab.

Also, and slightly more complicated, I want to have a new tab button that is always on the right hand side of the last tab in the tabcontrol.

Could anyone point me in a direction to get started? I've seen examples of people using Blend for this to create the new template. So far I've not been using that but have just downloaded the trial...

Thanks.

解决方案

In this article (referred to MVVM) the author make use of control templates to style the tabs, with close button et al.

Or you can go more basic with this sample

这篇关于WPF TabControl ControlTemplate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆