コード例 #1
0
        ///<summary>
        ///showTantoushaList
        ///コード入力項目でのキー入力判定
        ///</summary>
        private void showTantoushaList()
        {
            //担当者リストのインスタンス生成
            TantoushaList tantoushalist = new TantoushaList(this, true);

            try
            {
                //担当者区分リストの表示、画面IDを渡す
                tantoushalist.StartPosition = FormStartPosition.Manual;
                tantoushalist.intFrmKind    = CommonTeisu.FRM_TANTOUSHA;
                tantoushalist.ShowDialog();

                txtMokuhyou.Focus();
                txtTantoushaCd.Focus();
            }
            catch (Exception ex)
            {
                //エラーロギング
                new CommonException(ex);
                return;
            }
        }
コード例 #2
0
        ///<summary>
        ///judTokuisakiKeyDown
        ///コード入力項目でのキー入力判定
        ///</summary>
        private void judTantoushaKeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F9)
            {
                //グループボックスかパネル内にいる場合
                if (this.Parent is GroupBox || this.Parent is Panel)
                {
                    TantoushaList tantoushaList = new TantoushaList(this.Parent.Parent, this);
                    tantoushaList.StartPosition = FormStartPosition.Manual;
                    tantoushaList.intFrmKind    = CommonTeisu.FRM_TANTOUSHA;
                    tantoushaList.ShowDialog();
                }
                //親画面がBaseFormの場合
                else if (this.Parent is BaseForm)
                {
                    TantoushaList tantoushaList = new TantoushaList(this.Parent, this);
                    tantoushaList.StartPosition = FormStartPosition.Manual;
                    tantoushaList.intFrmKind    = CommonTeisu.FRM_TANTOUSHA;
                    tantoushaList.ShowDialog();
                }
                //親画面がLIST画面の場合
                else
                {
                    //他と判別させるために空のオブジェクトを作成する
                    object obj = new object();

                    TantoushaList tantoushaList = new TantoushaList(this.Parent, this, obj);
                    tantoushaList.StartPosition = FormStartPosition.Manual;
                    tantoushaList.intFrmKind    = CommonTeisu.FRM_TANTOUSHA;
                    tantoushaList.ShowDialog();
                }
            }
            else if (e.KeyCode == Keys.Enter)
            {
                //TABボタンと同じ効果
                SendKeys.Send("{TAB}");
            }
        }