(PPT添加)PowerPoint窗口的宽度和高度

时间:2012-12-31 08:34:50

标签: c# ms-office powerpoint office-addins

在我的PPT添加中我想显示一个WPF弹出窗口,它应该根据PPT窗口居中。

这是我的代码:

// get the postion and size of ppt window
float winLeft = Globals.ThisAddIn.Application.Left;
float winTop = Globals.ThisAddIn.Application.Top;
float winWidth = Globals.ThisAddIn.Application.Width;
float winHeight = Globals.ThisAddIn.Application.Height;

// set the position of WPF window            
this.Left = winLeft + (winWidth - this.Width) / 2;
this.Top = winTop + (winHeight - this.Height) / 2;

我可以使用 Globals.ThisAddIn.Application 以某种方式获取当前PPT窗口 Left Top Width 高度与屏幕上的实际大小不同(在我的电脑中,值较小)

我想知道屏幕上是否有窗口大小转换为实际大小

0 个答案:

没有答案