zoukankan      html  css  js  c++  java
  • 按下tab和shift tab 跳不出Spread 11 ,14的解决方法

    1、有表头,无数据(也就是数据是0件)的情况,需要增加以下代码。

            private void fpSpread1_KeyUp(object sender, KeyEventArgs e)
            {
                if (e.KeyData == Keys.Tab)
                {
                    if (fpSpread1.ActiveSheet.ActiveRowIndex == fpSpread1.ActiveSheet.RowCount - 1 &&
                        fpSpread1.ActiveSheet.ActiveColumnIndex == -1)
                    {
                        Control p;
                        p = ((FarPoint.Win.Spread.FpSpread)sender).Parent;
                        p.SelectNextControl(ActiveControl, true, true, true, true);
                    }
                }
                else if (e.KeyData == (Keys.Tab | Keys.Shift))
                {
                    if (fpSpread1.ActiveSheet.ActiveRowIndex == fpSpread1.ActiveSheet.RowCount - 1 &&
                        fpSpread1.ActiveSheet.ActiveColumnIndex == -1)
                    {
                        Control p;
                        p = ((FarPoint.Win.Spread.FpSpread)sender).Parent;
                        p.SelectNextControl(ActiveControl, false, true, true, true);
                    }
                }
            }
    

      

    2、有表头,有数据。(需要增加输入映射)

      第一种方法:(画面实现)

             通过打开 Spread设计器 -> 设置 -> 输入映射(此时会打开 输入映射编辑器),将 tab和shift tab 的映射进行增加。

            tab:MoveToNextCellThenControl

            shift + tab:MoveToPreviousCellThenControl

    第二种方法:(代码实现)

                InputMap im = this.GetInputMap(InputMapMode.WhenFocused);
                im.Put(new Keystroke(Keys.Tab, Keys.None), SpreadActions.MoveToNextCellThenControl);
                im.Put(new Keystroke(Keys.Tab, Keys.Shift), SpreadActions.MoveToPreviousCellThenControl);
    

      

  • 相关阅读:
    Java -- 最简单的认识重载
    maven打包spring boot项目及跳过test文件
    springboot 配置elasticsearch Java High Rest Client
    面向对象与面向过程的区别
    vue --- axios拦截器+form格式请求体
    kotlin --- 时间戳与字符串互相转换
    各种技术的路线图
    bpmn-js起步
    纵观 jBPM:从 jBPM3 到 jBPM5 以及 Activiti5
    几大工作流引擎对比
  • 原文地址:https://www.cnblogs.com/wzihan/p/14828198.html
Copyright © 2011-2022 走看看