问题描述
我想拦截事件在.NET Windows窗体,当用户通过修改标签的TabControl双击标签(而不仅仅是单一单击它)。
I would like to intercept the event in a .NET Windows Forms TabControl when the user has changed tab by double-clicking the tab (instead of just single-clicking it).
你有我怎么能做到这一点任何想法?
Do you have any idea of how I can do that?
推荐答案
中的TabControl的MouseDoubleClick事件似乎回应蛮好双击。唯一的额外步骤我会做的是设置一个短定时器TabIndexChanged事件后跟踪一个新的标签已被选中,忽略任何双击这种情况发生在定时器之外。这将prevent双击所选的选项卡。
The MouseDoubleClick event of the TabControl seems to respond just fine to double-clicking. The only additional step I would do is set a short timer after the TabIndexChanged event to track that a new tab has been selected and ignore any double-clicks that happen outside the timer. This will prevent double-clicking on the selected tab.
这篇关于.NET:双击事件的TabControl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!