0
こんにちは皆、私はユーザーコントロールである単純なウィンドウフォームを作成しました。私のアドインの起動時に、私はそのユーザーコントロールを呼びたいと思う。アプリケーションを実行すると、サイドウィンドウのようなフォームの情報を読み込まずに、Wordアプリケーションが開かれます。WordアドインでWindowsフォームを開く
これまで私がこれまで持っていたことは次のとおりです。ここで
namespace WordAddIn2
{
public partial class ThisAddIn
{
SidePane sP;
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
sP = new SidePane();
sP.Show();
}
private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
{
sP.Hide();
}
#region VSTO generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InternalStartup()
{
this.Startup += new System.EventHandler(ThisAddIn_Startup);
this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
}
#endregion
}
}
は、サイドペインの形式である:
namespace WordAddIn2
{
public partial class SidePane : UserControl
{
public SidePane()
{
InitializeComponent();
}
private void label1_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
Process.Start("explorer.exe", "-p");
}
}
}
誰かが私が私の単純なエラーを識別するのに役立つことができれば、それは素晴らしいだろう。
にあなたの可視性を設定することを忘れないでください。 ThisAddIn.CustomTaskPanes.Add(、 "<任意の名前/タイトル>"); ' –
Crowcoder
SidePaneは私のフォームの名前です。私はその行為が何をすべきかという名前をつけた...混乱のために残念。 –
そう、それを見たはずだった。だから、そのインスタンスを 'Globals.ThisAddin.CustomTaskPanes'に追加してください。 – Crowcoder