简体   繁体   English

C#如何将标签页与Firefox或Google Chrome这样的tabcontrol分开?

[英]C# How can I separate a tab from tabcontrol like Firefox or Google Chrome?

I add a tab to my tabcontrol with a buttonclick and I can close these tabs with the middle mouse button. 我使用buttonclick将标签添加到我的tab控件中,并且可以使用鼠标中键关闭这些标签。 Now I want add that I can separate the tabs like Chrome or Firefox. 现在,我想补充一点,我可以分开Chrome和Firefox等选项卡。 For that I must click down the mouse and move them out to separate which handler is that or how can i realize that? 为此,我必须单击鼠标并将它们移出以分开那个处理器,或者我怎么能意识到这一点?

Update 更新资料

I use Visual Studio 2015 with Winforms 我将Visual Studio 2015与Winforms一起使用

I think what you should do is create a new control on click, one that has all the children of the tab you want to separate (and then dispose the old tabwindow control). 我认为您应该做的是在点击时创建一个新控件,该控件具有您要分离的选项卡的所有子项(然后放置旧的tabwindow控件)。 Then when you have this separate control, you can implement dragging, and handle a drop on the tab control you want it to add to. 然后,当您拥有此单独的控件时,可以实现拖动,并处理要添加到的选项卡控件上的放置。 The dropping handler would contain code that transforms the new control back to a tabwindow, and adds it to the tabcontrol. 删除处理程序将包含将新控件转换回TabWindow并将其添加到TabControl的代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM