您好可以使用SelectionStart 设置光标位置
- private void FpSpread1_EditChange(object sender, FarPoint.Win.Spread.EditorNotifyEventArgs e)
- {
- if (e.EditingControl is FarPoint.Win.Spread.CellType.GeneralEditor)
- {
- var editor = e.EditingControl as FarPoint.Win.Spread.CellType.GeneralEditor;
- string value = editor.Value != null ? editor.Value.ToString() : string.Empty;
- if (value.EndsWith("s"))
- {
- editor.Value = value.Remove(value.Length - 1);
- }
- editor.SelectionStart = value.Length;
- }
- }
复制代码 |