C#ContextMenu游标 [英] C# ContextMenu Cursor

查看:130
本文介绍了C#ContextMenu游标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我有一个ContextMenu在系统级事件中打开.我已经钩住了鼠标右键消息,以在AxShockwaveFlash对象上显示此菜单.问题在于,显然这些类都不继承自Control(因此它们不具有Control.Cursor属性).如果我的光标是AxShockwaveFlash对象中的IBeam,则即使在我的ContextMenu上,我的光标也仍然是IBeam.

在这种情况下,有什么方法可以覆盖游标吗?我尝试过更改父控件的光标(this.Parent.Cursor),但是按预期,它不会产生任何变化.

Hello, I have a ContextMenu that opens on a system level event. I have hooked a right mouse button down message to display this menu on an AxShockwaveFlash object. The problem is that apparently neither of these classes inherit from Control (so they do not have the Control.Cursor property). If my cursor is an IBeam in the AxShockwaveFlash object, my cursor remains an IBeam, even over my ContextMenu.

Is there any way to override the cursor in this situation? I have tried changing the parent control''s cursor (this.Parent.Cursor) but this, expectantly, yields no change.

推荐答案

我希望您会使用p/调用以调用SetCursor(这是一个猜测)或可以与该对象上的Handle一起使用的类似东西(假定它具有一个,就是它的hWnd)
I would expect you''d use p/invoke to call SetCursor ( that''s a guess ) or something similar which can work with the Handle on the object ( assuming it has one, that''s it''s hWnd )


这篇关于C#ContextMenu游标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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