双击选项卡控件标题 [英] Doubleclicking tab control header

查看:37
本文介绍了双击选项卡控件标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直想知道这个问题 - 双击 winforms TabControl 的标题没有被检测到,但我想处理这个事件.

I've been wondering about this problem for some time - doubleclicking a winforms TabControl's header doesn't get detected, but I'd like to handle this event.

看起来所有鼠标事件(单击、移动等)在 TabControl 的非活动"区域上都不会引发.我什至尝试对 TabControl 进行子类化,但也不会引发派生类的事件.覆盖 WndProc 表明它没有收到 WM_LBUTTONDBLCLK 消息(我的意思是 - WTF?).

It looks like all mouse events (click,move,etc.) don't get raised when they are on the 'inactive' area of TabControl. I've even tried subclassing TabControl, but the derived class' events aren't raised too. Overriding WndProc shown that it doesn't receive WM_LBUTTONDBLCLK message (I mean - WTF?).

谢谢.但我确信选项卡控件知道我点击了它的标题,它只是不让我知道.

Thanks. But I'm sure that the tab control knows that I've clicked on its header, it just doesn't let me know.

附言我看过 .NET : Double-click event in TabControl - 但是什么都没有

p.s. I've looked at .NET : Double-click event in TabControl - but nothing

推荐答案

嗯...我做了一个测试项目,我得到了 MouseDoubleClick 和 DoubleClick 事件.Tabcontrol 的标题"是什么意思?实际选项卡或空白区域是否会显示附加选项卡?

Hm...I did a test project and I am getting both MouseDoubleClick and DoubleClick events. What do you mean by "Tabcontrol's header"? An actual tab or the blank area were additional tabs would show?

我使用了 eventspy.zip

如果您的意思是空白区域(您通过评论所做的)那么不,因为空白区域中没有任何内容.无控制.您需要做的是将 TabControl 放在 Panel 中,并将 TabControl 的 Dock 属性设置为 Fill.处理面板的双击事件.

If you mean the blank area (which you do by the comment) then no, because there is nothing in the blank area. No control. What you need to do is put the TabControl in a Panel, and set the TabControl's Dock property to Fill. Handle the Panel's double-click events.

这篇关于双击选项卡控件标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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