0
我使用VSTO/.NET4.0创建Excel插件。我想将控件(按钮和组合框)嵌入到工作表中。我使用下面的代码,但是一旦我保存工作簿,关闭它并重新打开它,该按钮就变成了一个没有功能的平面图像。我究竟做错了什么?任何帮助将不胜感激!单元格中的VSTO excel按钮
System.Windows.Forms.Button b = new System.Windows.Forms.Button();
b.Text = "Run";
sheet.Controls.AddControl(b, (sheet.Cells[rowidx, colidx] as Range),"buttonName");
b.Click += this.runSimulation;