回复 1楼beitesting的帖子
1 .net下keydown事件,默认情况是可直接触发的:当在Spread内key按下的时候。
2 在Edit模式下,需要特殊设置才可触发KeyDown事件,参考代码如下:
- private void Form1_Load(object sender, EventArgs e)
- {
- fpSpread1.EditModePermanent = true;
- fpSpread1.EditModeReplace = true;
- fpSpread1.EditMode = true;
- fpSpread1.EditModeOn +=fpSpread1_EditModeOn;
- fpSpread1.EditModeOff +=fpSpread1_EditModeOff;
- }
- private void fpSpread1_KeyDown(object sender, KeyEventArgs e)
- {
- }
- private void fpSpread1_EditModeOn(object sender, System.EventArgs e)
- {
- KeyEventHandler keyDown = new KeyEventHandler(fpSpread1_KeyDown);
- fpSpread1.EditingControl.KeyDown += keyDown;
- }
- private void fpSpread1_EditModeOff(object sender, System.EventArgs e)
- {
- KeyEventHandler keyDown = new KeyEventHandler(fpSpread1_KeyDown);
- fpSpread1.EditingControl.KeyDown -= keyDown;
- }
复制代码
ActiveX和.net下对应的事件、属性参考列表文档路径:Spread COM File Member Equivalents |