回复 1楼cure_shy的帖子
实现代码如下:
- public Form1()
- {
- InitializeComponent();
- this.fpSpread1.SheetTabClick += new FarPoint.Win.Spread.SheetTabClickEventHandler(fpSpread1_SheetTabClick);
- this.fpSpread1.TabStripPolicy = FarPoint.Win.Spread.TabStripPolicy.Always;
- }
- int i = 0;
- void fpSpread1_SheetTabClick(object sender, FarPoint.Win.Spread.SheetTabClickEventArgs e)
- {
- //确认添加新表单
- if (e.SheetTabIndex == -1)
- {
- SheetView sv = new SheetView();
- sv.Cells[0, 0].Text = "test";
- sv.SheetName = i.ToString();
- this.fpSpread1.Sheets.Add(sv);
- int sheetCount = this.fpSpread1.Sheets.Count;
- this.fpSpread1.Sheets.RemoveAt(sheetCount - 2);
- i++;
- }
- }
复制代码 |