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);
    

      

  • 相关阅读:
    ASP.NET中在一般处理程序中使用session的简单介绍
    oracle 11gR2安装图文教程
    ORACEL 创建表空间
    Echarts使用心得总结(二)
    SqlServer 2008无法远程连接到服务器
    浅谈HTTP中Get与Post的区别
    java设计模式-观察者模式学习
    读牛人博客有感
    mysql的with rollup
    java中的枚举enum
  • 原文地址:https://www.cnblogs.com/wzihan/p/14828198.html
Copyright © 2011-2022 走看看