English 中文(简体)
如何检测鼠鼠标是否在上下文菜单上方
原标题:How to detect if the mouse is over the context menu
  • 时间:2012-05-24 19:49:33
  •  标签:
  • c#
  • .net
  • wpf

在应用有效时,我有一些机制可以隐藏鼠标。

但现在我为主窗口窗体添加了一个上下文菜单。所以当鼠标在上下文菜单下时,它总是隐藏鼠标。

<强> 如何检测鼠标是否在上下文菜单上方?

谢谢你的线索!

P. S.. · · · · · · · · ·

应用程序工作时此代码隐藏鼠鼠鼠

  void CursorTimer_Tick(object sender, EventArgs e)
        {
            TimeSpan delta = DateTime.Now.Subtract(this.CursorLastMoveTime);
            if (delta.TotalSeconds > 3)
            {
                CursorTimer.Stop();
                Mouse.OverrideCursor = System.Windows.Input.Cursors.None;
            }
        }
最佳回答
问题回答

Just a thought, but why not stop you timer and Show your mouse when the context menu is open. Then start the timer and hide your mouse When the context menu closes





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签