当加载一个插件时,我正在尝试打开一个用户控件。以下是外接程序启动事件处理程序中的代码:
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;
}当打开时没有在侧窗格中显示任何内容,这可能是什么问题?
发布于 2017-08-29 00:50:49
需要设置为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;
}https://stackoverflow.com/questions/45923791
复制相似问题