回复 7楼lucky的帖子
基于上面的需求,写了短代码,供您参考:
- fpSpread1.ActiveSheet.SelectionPolicy = FarPoint.Win.Spread.Model.SelectionPolicy.Single;
- fpSpread1.ActiveSheet.SelectionUnit = FarPoint.Win.Spread.Model.SelectionUnit.Row;
- fpSpread1.ActiveSheet.Rows[1].Locked = true;
- fpSpread1.ActiveSheet.Rows[2].Locked = true;
- fpSpread1.ActiveSheet.Rows[3].Locked = true;
- void fpSpread1_CellDoubleClick(object sender, FarPoint.Win.Spread.CellClickEventArgs e)
- {
- this.textBox1.Text = fpSpread1.ActiveSheet.Cells[e.Row, e.Column].Text;
- e.Cancel = true;
- textBox1.Focus();
- }
复制代码
思路如下:
1 UI布局:上面是Spread, 下面有一个TextBox
2 响应CellDoubleClick事件 |