查看鼠标是否在链接上-Web浏览器 [英] See whether mouse is on a link -- web browser

查看:118
本文介绍了查看鼠标是否在链接上-Web浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我正在创建一个类似于chrome/的网络浏览器,也就是说,我希望在链接悬停时更改上下文菜单栏.

因此,当您右键单击某个链接时,如果没有鼠标悬停在链接上,则该菜单将显示与之前不同的上下文菜单.

提前谢谢!

基本上,当链接悬停在上面时,我想查看它是否为链接,然后是否要更改Web浏览器的上下文菜单.

Hey, I am creating a web browser which is a bit like chrome/ ie in the sense that I want the context menu strip to change once a link is hovered upon.

So when you right click on a link it displays a different context menu to the one before if no link has the mouse hovered on them.

Thanks in advance!

Basically when a link is hovered upon I would like to see if it is a link and if it is then to change the web browser''s context menu

推荐答案

上下文菜单应该仅位于实例上,但是如果使用Forms,则可以在System.Windows.Controls.ContextMenu.ContextMenuOpening的处理程序中修改项目.对于WPF,它将是事件System.Windows.Controls.ContextMenu.ContextMenuOpening的处理程序.
请参阅我对一个非常类似的问题的回答:
基于treeView中xml元素的contextMenu [ ^ ]

—SA
The context menu should be in only on instance, but the items can be modified in the handler of System.Windows.Controls.ContextMenu.ContextMenuOpening, if you use Forms. For WPF, it will be a handler of the event System.Windows.Controls.ContextMenu.ContextMenuOpening.

Please see my answer to a very similar question:
contextMenu based on xml element in treeView[^]

—SA


这篇关于查看鼠标是否在链接上-Web浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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