在 Windows 窗体中舍入选项卡标题
我使用 Windows 窗体创建了一个 TabControl,但选项卡标题看起来非常难看。我想让它们带有圆角,并在两个选项卡标题之间创建一些空间。谁能告诉我如何使用 C# 来完成它。
谢谢, 加里
I created a TabControl using Windows Forms but the tab headers look very ugly. I want to make them with rounded corners and also create some space between two tab headers. Can anyone please tell how it can be done using C#.
Thanks,
gary
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要执行以下操作之一:
开箱即用的
System.Windows.Forms.TabControl
无法实现此目的,因此您必须要么接受已有的,要么自行推出。不想引发任何激烈的争论,但 WinForms 是一个老化的 API。如果您正在构建全新的应用程序和/或第一次学习 UI 框架,您可能会考虑使用 WPF。对于遗留代码,当然可以维护 WinForms。
You'll want to do one of a few things:
There isn't a way to do this with
System.Windows.Forms.TabControl
out of the box, so you'll have to either live with what you've got, or roll your own.Not to spark any heated debate, but WinForms is an aging API. If you're building a brand new application and/or learning a UI framework for the first time, you might consider using WPF instead. For legacy code, it's fine to maintain WinForms of course.
System.Windows.Forms.TabControl 类只是 Windows COMCTL32 选项卡控件的包装器。不幸的是,该控件没有提供太多自定义选项。您必须切换控件,要么切换到 WPF、自定义代码,要么切换到某些第三方产品。
The System.Windows.Forms.TabControl class is just a wrapper around the Windows COMCTL32 tab control. Unfortunately, that control doesn't provide much in the way of customization options. You'll have to switch controls, either to WPF, custom code, or some third-party product.