您好,
我这边实现的思路是第一个控件触发一个CellChanged的方法,在里面设置combobox的值。
自定义enter的方式为,移动到下一个列。- public Form1()
- {
- InitializeComponent();
- this.fpSpread1.Sheets[0].CellChanged += new FarPoint.Win.Spread.SheetViewEventHandler(Form1_CellChanged);
- this.fpSpread1.Sheets[0].Cells[0, 1].TabStop = false;
- InputMap im = new InputMap();
- Keystroke keyStroke = new Keystroke(Keys.Enter, Keys.None);
- im = fpSpread1.GetInputMap(InputMapMode.WhenFocused);
- im.Put(keyStroke,SpreadActions.MoveToNextColumn);
- }
- void Form1_CellChanged(object sender, FarPoint.Win.Spread.SheetViewEventArgs e)
- {
- //this.fpSpread1.Sheets[0].Cells[0,1].c
- if (this.fpSpread1.Sheets[0].Cells[0, 0].Value == null)
- return;
- string s = this.fpSpread1.Sheets[0].Cells[0, 0].Value.ToString();
- this.fpSpread1.Sheets[0].Cells[0, 1].Value = s;
- }
复制代码
希望能够帮助到您。 |