1
我已经创建了一个Outlook插件,并在这里添加自定义taskpane它自动调整不同屏幕上的Outlook自Taskpane自动
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
taskpane = this.CustomTaskPanes.Add(new UCMaster(), "Summit Service Management");
UserControl ucmaster = taskpane.Control;
eh = new ElementHost { Child = new WPFUCMaster(new WPFUCLogin()) };
eh.Dock = DockStyle.Fill;
eh.AutoSize = true;
ucmaster.Controls.Add(eh);
taskpane.DockPosition = Office.MsoCTPDockPosition.msoCTPDockPositionRight;
taskpane.DockPositionRestrict = Office.MsoCTPDockPositionRestrict.msoCTPDockPositionRestrictNoChange;
taskpane.Width = 460;
taskPaneWidth = taskpane.Width;
taskPaneHeight = taskpane.Height;
ucmaster.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right);
ucmaster.AutoSizeMode = AutoSizeMode.GrowAndShrink;
ucmaster.AutoSize = true;
int h = ucmaster.Height;
int w = ucmaster.Width;
initialAddinInstance = this;
ucmaster.BringToFront();
}
IM根据我的屏幕尺寸和它在寻找妥善解决硬编码taskpane宽度。
但是,在不同的屏幕,我观察像任务窗格正在压缩或以任何其他方式。
我的问题是我如何可以根据当前的系统屏幕分辨率和尺寸按字母顺序更改任务窗格宽度?