Visio 形状上的双击事件 [英] Double-click event on a Visio shape

查看:35
本文介绍了Visio 形状上的双击事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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. 我使用 C# + Visio 2007 SDK.

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

推荐答案

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

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.

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

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.

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

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.

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

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.

这篇关于Visio 形状上的双击事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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