我正在尝试在加载加载时打开用户控件。以下是Add-in Startup事件处理程序中的代码:
private SidePane sidePane;
private Microsoft.Office.Tools.CustomTaskPane cTP;
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
sidePane = new SidePane();
cTP = this.CustomTaskPanes.Add(sidePane, "MyTaskPane");
cTP.Visible = true;
}
当在侧窗格中打开任何显示时,可能是什么问题?
答案 0 :(得分:0)
您需要设置为width属性
public Microsoft.Office.Tools.CustomTaskPane myCustomTaskPane { get; set; }
public CustomPaneUserControl cPaneUserControl = new CustomPaneUserControl();
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
myCustomTaskPane = Globals.ThisAddIn.CustomTaskPanes.Add(cPaneUserControl, "Verime");
myCustomTaskPane.Width = 300;
myCustomTaskPane.Visible = true;
myCustomTaskPane.DockPosition = Office.MsoCTPDockPosition.msoCTPDockPositionRight;
}