C# 工具提示插件
你好,我想用 C# 开发一个 Visual Studio 插件,以便在光标落在特定文本上时显示工具提示文本。
例如,如果有一行名为 Hello,我希望它在以下情况下弹出工具提示“hello world”我将鼠标光标放在上面 请帮帮我
hi i want to develop an addin to Visual studio in c# to display a tool tip text when the cursor lands on a particular text..
ex- if there is a line called Hello i want it to popup a tool tip "hello world " when i land the mouse cursor on it
please help me out
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Visual Studio 2010 插件编写文章/教程?
而不是仅仅问如何要完成整个任务,请就您在执行任务时遇到的问题提出一个具体问题。有很多关于如何制作 VS2010 插件(或任何其他版本)的教程。开始编码,看看问题最终来自哪里。
Visual Studio 2010 addin writing articles/tutorials?
Rather than just ask how to do an entire task, ask a specific question about a problem you're having doing it. There are lots of tutorials around on how to make a VS2010 addin (or any other version). Start coding one and see where the problems end up coming from.
如果您指的是文本光标,那么可以使用插件来实现。事实上,这很容易。只需处理 TextDocumentKeyPressEvents 即可。该文章中还有一个完整的加载项示例。
如果您的意思是用鼠标指针悬停文本,则加载项中不直接支持它。您需要使用一些全局鼠标事件处理程序并手动检索指针下的文本。或者,我相信 VS 包对此类任务有更好的支持。
If you mean the text cursor, then this is possible with an add-in. In fact, it's quite easy. Just handle TextDocumentKeyPressEvents. There's also a complete add-in example in that article.
If you mean hovering a text with the mouse pointer, there's no direct support for it in add-in. You would need to use some global mouse events handler and manually retrieve the text under the pointer. Or, I believe, VS packages have better support for such tasks.