Powerpoint 中的 VSTO:更改 WindowSelectionChange 中的自定义任务窗格可见性会移动选定的形状
我想我发现了一个错误。 我正在为 Powerpoint 2010 开发一个加载项。当选择/取消选择形状(例如图片)时,将触发 WindowSelectionChange 事件。 但是,如果我使用此事件更改自定义任务窗格的可见性属性,则形状会在幻灯片上向左/向右移动。示例:
Private Sub Application_WindowSelectionChange(Sel As Microsoft.Office.Interop.PowerPoint.Selection) Handles Application.WindowSelectionChange
cTaskPane.Visible = Not cTaskPane.Visible
End Sub
我尝试监视形状的 Left 属性,并且该属性从 WindowSelectionChange 子项的开始到结束都没有改变。因此,这件事必须是事后发生的。
我怎样才能避免这种情况? 有什么解决办法吗?
I think I have found a bug.
I am developing a add-in for Powerpoint 2010. The event WindowSelectionChange is fired when a shape (e.g. a picture) is selected/deselected.
However, if I use this event to change the Visibility property of a Custom Task Pane, then the shape moves left/right on the slide. Example:
Private Sub Application_WindowSelectionChange(Sel As Microsoft.Office.Interop.PowerPoint.Selection) Handles Application.WindowSelectionChange
cTaskPane.Visible = Not cTaskPane.Visible
End Sub
I have tried to monitor the Left property of the shape, and that does not change from the beginning to the end of the WindowSelectionChange sub. Thus, it must happen afterwards.
How can I avoid this?
Any workaround?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是因为你的鼠标按住了形状,当窗口缩小时,形状会向右移动。
更详细地说,移动分 4 个步骤进行:
为了避免这种情况,我建议您使用 WindowSelectionChange 事件并检查选择是否为形状(代码在 c# 中):
It's because your mouse is holding the shape, and the shape gets moved to the right when the window is shrunk.
In more detail, the moving occurs in 4 steps:
To avoid this, I suggest you use WindowSelectionChange event and check if the selection is shape (code is in c#):