GcSpreadSheet自定义Tab键
自定义Tab键功能有两个问题,麻烦帮个忙!1.怎么暂时禁用Tab键功能,有需要的时候重新启用;
2.按照需求,按Tab之后跳到指定的位置,比如指定行列或者指定标识!
删除掉默认的keymap ,然后在合适的时机自己加上
Dictionary<GrapeCity.Windows.SpreadSheet.UI.KeyStroke, GrapeCity.Windows.SpreadSheet.UI.SpreadAction> keyMap = Spreadsheet1.View.KeyMap;
var tabKey = keyMap.First(k => k.Key.KeyCode == Key.Tab);
keyMap.Remove(tabKey.Key);
keyMap.Add(new GrapeCity.Windows.SpreadSheet.UI.KeyStroke(Key.Tab, ModifierKeys.None), (sender, e) =>
{
var sheet = sender as SheetView;
int myCellRow = 3, myCellCol = 3;
sheet.SetActiveCell(myCellRow, myCellCol, true);
}); dexteryao 发表于 2016-8-30 14:09
删除掉默认的keymap ,然后在合适的时机自己加上
如果要重新添加Tab键功能怎么做?用keyMap.Add(tabKey.Key,tabKey.Value)好像不起作用啊! 还原的话您这个
keyMap.Add(new GrapeCity.Windows.SpreadSheet.UI.KeyStroke(Key.Tab, ModifierKeys.None), new GrapeCity.Windows.SpreadSheet.UI.SpreadAction(GrapeCity.Windows.SpreadSheet.UI.SpreadActions.NavigationNext));
还原的话您这个
keyMap.Add(new GrapeCity.Windows.SpreadSheet.UI.KeyStroke(Key.Tab, ModifierKeys.None), new GrapeCity.Windows.SpreadSheet.UI.SpreadAction(GrapeCity.Windows.SpreadSheet.UI.SpreadActions.NavigationNext));
页:
[1]