Visio 形状上的双击事件

发布于 2024-11-29 02:55:25 字数 135 浏览 1 评论 0原文

如何捕获 Visio 形状上的双击事件?我想在用户双击形状时显示一些属性,但为此我首先需要捕获此事件。

任何建议都非常受欢迎。 多谢。

PS 我使用C# + Visio 2007 SDK。

How can I catch a double click event on a Visio shape? I would like to display some properties when the user double-click on the shape but to do so I first need to catch this event.

Any suggestion is very welcome.
Thanks a lot.

P.S. I use C# + Visio 2007 SDK.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

北城挽邺 2024-12-06 02:55:25

我不确定 Visio API 中是否有可用的双击事件。我从来没有见过一个。但是,您可以设置一个形状,通过形状表窗口向某些代码过程报告双击。要到达那里,请选择一个形状,然后转到“窗口”->“显示形状表”,您将看到一个类似电子表格的窗口,其中描述了有关该形状的几乎所有内容。

应该有一个事件部分(如果没有右键单击灰色区域并选择“插入部分”并选择它),您可以在其中指定 EventDblClick 单元格中的形状表函数,以便在双击该形状时调用。您可以使用 CALLTHIS 或 RUNADDON 之类的东西来获取您想要执行的代码。

不幸的是,这样做需要您在尝试观看之前设置要观看的形状。您可以以编程方式设置 EventDblClick 单元格公式,这样您就可以在打开插件时执行此操作。或者您可以手动设置并通过模板提供您想要观看的形状。

您还可以监视活动 Visio.Window 对象上的 MouseUp 事件,如果在一段时间内有两次鼠标按下,则将其算作双击...

可能还有其他方法,但我不知道他们。

I'm not sure there is a double click event available in the Visio API. I've never seen one. You can, however, set up a shape to report a double click to some code procedure, through the shapesheet window. To get there, select a shape, and go to Window->Show Shapesheet, and you'll see a spreadsheet-looking window that describes pretty much everything about the shape.

There should be an Events section (if not right click in the gray area and select "insert section" and pick it), where you can specify a shapesheet function in the EventDblClick cell to get called on double clicking that shape. You'd use something like CALLTHIS or RUNADDON to get to the code you want to execute.

Unfortunately, doing it this way requires you to set up the shape(s) you want to watch before you try to watch them. You can set the EventDblClick cell formula programmatically, so you could do that on opening your addin. Or you could set that up manually and provide the shapes you want to watch through a stencil.

You could also watch for the MouseUp event on the active Visio.Window object, and if there are two mouseups in some amount of time, count that as a double click...

There may be other ways, but I don't know of them.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文