Cursor.Hide和工具条的问题 [英] Problem with Cursor.Hide and the toolstrip

查看:75
本文介绍了Cursor.Hide和工具条的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在隐藏鼠标光标方面遇到了一些麻烦。

I'm having a little trouble hiding the mouse cursor.

我有一个Winforms C#程序(VS2010),带有一个显示视频源的专有控件。

I have a Winforms C# program (VS2010) with a proprietary control that displays a video feed.

视频控件设置为Dock.Full。

The video control is set to Dock.Full.

表单还有一个Systems.Windows.Forms.Toolstrip。

The form also has a Systems.Windows.Forms.Toolstrip.

我最初做的是设置MouseEnter事件处理程序来关闭光标(Cursor.Hide)和MouseLeave来打开光标(Cursor.Show)。

What I did initially was set the MouseEnter event handler to turn off the cursor (Cursor.Hide) and the MouseLeave to turn on the cursor (Cursor.Show).

什么我不明白当我将鼠标移到工具条上时,这些MouseEnter / Leave事件似乎正在发生。

What I don't understand is that these MouseEnter/Leave events seem to be taking place when I move the mouse over the toolstrip.

(我还为工具条添加了事件处理程序,但是似乎只是混淆了这种情况。我真的不确定如何描述正在发生的事情。)

(I've also added event handlers for the toolstrip but that only seems to confuse the situation.  I'm not really sure how to describe what's happening.)

理想情况下我想要的是鼠标光标在隐藏时隐藏视频控件,但在工具栏上方可见。

推荐答案

如果我理解你的话y,您是否已为表单的事件添加了事件处理程序?您可以将事件处理程序添加到窗体的MouseMove事件中,并检查光标是否在视频控件上并隐藏/显示它。

If I understand you correctly, you have added the event handlers for the form's events? You could add the event handler to the MouseMove event for the form and check if the cursor is over the video control and hide/show it appropriately.

专有控件是否显示鼠标* **事件?

Doesn't the proprietary control expose Mouse*** events?


这篇关于Cursor.Hide和工具条的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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