如何在TabControl的TabPage行上添加特定的框(按钮) [英] How to add a specific box(button) on TabPage row of TabControl

查看:570
本文介绍了如何在TabControl的TabPage行上添加特定的框(按钮)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在MainForm中添加了一个TabControl,当然,我在此TabControl上分配了几个TabPage,并为每个TabPage包括了它的控件.

TabPages将显示在"TabPage行(?)"上,当有更多TabPages时,它将在用户的"TabPage行"右侧弹出两个箭头框"单击并移动TabPage.

现在的问题如下:
1.如何在"TabPage行"的右侧添加特定的框(按钮),以便用户可以单击此框(按钮)以具有特定的功能?
2.如果显示箭头框",我如何始终将特定的框(按钮)保持在箭头框"的右侧?

I add a TabControl in MainForm, and of course, I assign several TabPages on this TabControl, and includes its control for each TabPage.

The TabPages will be shown on the ''TabPage row (?)'', and when there are more TabPages, it then will pop up two ''arrow box'' on the right hand of the ''TabPage row'' for user to click and shift the TabPage.

The questions now are below :
1. How can I add specific box(button) on the right hand of the ''TabPage row'', so that user can click this box(button) to have specific fucntion ?
2. If the ''arrow box'' is shown, how can I always keep the specific box(button) be at right hand of the ''arrow box'' ?

推荐答案

TabControl中没有"TabPage行"这样的概念.您所能做的就是在TabControl控件的右边添加一些额外的控件,并组织它们之间的协作.最好的方法是创建一个自定义控件.使用Control.DockControl.Padding属性可以满足您对布局的所有要求.或者,您可以基于System.Windows.Forms.ControlSystem.Windows.Forms.TabControl开发具有所有所需功能的自定义控件.

我无法提供更多详细信息,因为您对所需功能的描述非常有限.

—SA
There is no such concept as "TabPage row" in TabControl. All you can do is adding some extra controls on right of your TabControl control and organize collaboration between them. The best way of doing this is creation a Custom Control. All your requirements to the layout could be met using Control.Dock and Control.Padding properties. Alternatively, you can develop a custom control with all the functionality you need based on System.Windows.Forms.Control or System.Windows.Forms.TabControl.

I cannot provide more details because your description of required functionality is very limited.

—SA


这篇关于如何在TabControl的TabPage行上添加特定的框(按钮)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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