对 C# 自定义选项卡控件的建议?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/210597/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-03 18:14:30  来源:igfitidea点击:

Suggestions for a C# custom tabcontrol?

c#tabcontrol

提问by Gary Willoughby

Has anybody got any suggestions for a custom tabcontrol implemented in C# and which adheres to these criteria:

有没有人对在 C# 中实现的自定义 tabcontrol 有任何建议,并遵守这些标准:

  • Allows the tabs to be placed along the side of the control.
  • Tab text must read horizontally.
  • Allow custom colouring.
  • Open source or no cost.
  • 允许将选项卡放置在控件的一侧。
  • 标签文本必须水平阅读。
  • 允许自定义着色。
  • 开源或免费。

I prefer not to get my hands dirty with ownerdrawingif a solution already exists.

如果解决方案已经存在,我宁愿不要用ownerdrawing弄脏我的手。

采纳答案by Cory

You probably don't have a need for this anymore but anyone else who stumbles upon it might find it useful.

您可能不再需要它,但任何偶然发现它的人可能会发现它很有用。

I found this tabcontrol on CodeProject it is also very easy to Draw your own tabs with it, they even give you a example on the site.

我在 CodeProject 上发现了这个选项卡控件,用它绘制自己的选项卡也很容易,他们甚至在网站上给了你一个例子。

Y(et)A(nother)TabControl

Y(et)A(nother)TabControl

A couple more tab controls.

几个选项卡控件。

TabStrip Control

标签条控件

TabStrips: A TabControl in the Visual Studio 2005 way!

TabStrips:Visual Studio 2005 中的 TabControl!

回答by Daniel Moore

The tab control in WPF fulfills all of your requirements. You can override the template and go to town on it.

WPF 中的选项卡控件满足您的所有要求。您可以覆盖该模板并前往镇上。