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

      

  • 相关阅读:
    bzoj 2816: [ZJOI2012]网络 (LCT 建多棵树)
    bzoj 2157: 旅游 (LCT 边权)
    bzoj 3669: [Noi2014]魔法森林 (LCT)
    bzoj 2049: [Sdoi2008]Cave 洞穴勘测 (LCT)
    bzoj 2002 : [Hnoi2010]Bounce 弹飞绵羊 (LCT)
    bzoj 3282: Tree (Link Cut Tree)
    模拟赛1
    Some tricks
    模拟赛简要题解与心得
    Noip 训练指南
  • 原文地址:https://www.cnblogs.com/wzihan/p/14828198.html
Copyright © 2011-2022 走看看