Esempio n. 1
0
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            ToolClickEventArgs eTool;
            ToolBase           utb;

            try
            {
                if (keyData == (Keys.Control | Keys.Enter))
                {
                    utb   = UtbmMain.Tools["BtOk"];
                    eTool = new ToolClickEventArgs(utb, null);
                    UtbmMain_ToolClick(UtbmMain, eTool);
                    //toolstripbutton_click(BtnOk, null);
                    return(true);
                }

                //if (keyData == (Keys.Control | Keys.A))
                //{
                //    if (FormQueryMode == YRQueryType.NA)
                //    {
                //        this.Close();
                //        return true;
                //    }
                //}

                if (keyData == (Keys.Escape))
                {
                    if (FormQueryMode == YRQueryType.NA)
                    {
                        this.Close();
                        return(true);
                    }
                    else if (FormQueryMode == YRQueryType.INQUERY)
                    {
                        if (uGrid_Master.ActiveCell != null && uGrid_Master.ActiveCell.IsInEditMode)
                        {
                            return(false);   //由grid原生事件處理
                        }
                        else
                        {
                            utb   = UtbmMain.Tools["BtCancel"];
                            eTool = new ToolClickEventArgs(utb, null);
                            UtbmMain_ToolClick(UtbmMain, eTool);
                            //toolstripbutton_click(BtnOk, null);
                            return(true);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                GlobalFn.ofShowDialog(ex.Message);
            }
            return(base.ProcessCmdKey(ref msg, keyData));
        }
Esempio n. 2
0
        private void FrmPickBase_Load(object sender, EventArgs e)
        {
            ToolClickEventArgs eTool;
            ToolBase           utb;

            try
            {
                if (MsgInfoReturned == null)
                {
                    WfSetSelectMode(1);
                    return;
                }

                WfIniVar();
                WfIniSqlBody();    //初始化sql字串
                WfIniMasterGrid();
                WfIniToolBarUI();

                utb   = UtbmMain.Tools["BtQuery"];
                eTool = new ToolClickEventArgs(utb, null);
                UtbmMain_ToolClick(UtbmMain, eTool);

                if (MsgInfoReturned.IsAutoQuery == true ||
                    (MsgInfoReturned.IsAutoQuery == null && GlobalFn.isNullRet(Admi650Model.azp08, "") == "Y"))
                {
                    this.FormQueryMode = YRQueryType.INQUERY;
                    utb   = UtbmMain.Tools["BtOk"];
                    eTool = new ToolClickEventArgs(utb, null);
                    UtbmMain_ToolClick(UtbmMain, eTool);
                }
                else
                {
                    WfDisplayMode();
                }

                this.Shown += FrmPickBase_Shown;
            }
            catch (Exception ex)
            {
                GlobalFn.ofShowDialog(ex.Message);
                this.Close();
            }
        }
Esempio n. 3
0
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            ToolClickEventArgs eTool;
            ToolBase           utb;

            try
            {
                if (keyData == (Keys.Control | Keys.Enter))
                {
                    utb   = UtbmMain.Tools["BtOk"];
                    eTool = new ToolClickEventArgs(utb, null);
                    UtbmMain_ToolClick(UtbmMain, eTool);
                    //toolstripbutton_click(BtnOk, null);
                    return(true);
                }

                if (keyData == (Keys.Q))
                {
                    if (_formQueryMode == YRQueryType.NA)
                    {
                        utb   = UtbmMain.Tools["BtQuery"];
                        eTool = new ToolClickEventArgs(utb, null);
                        UtbmMain_ToolClick(UtbmMain, eTool);
                        //toolstripbutton_click(BtnQuery, null);
                        return(true);
                    }
                }

                if (keyData == (Keys.Escape))
                {
                    this.Close();
                    return(true);
                }
            }
            catch (Exception ex)
            {
                GlobalFn.ofShowDialog(ex.Message);
            }
            return(base.ProcessCmdKey(ref msg, keyData));
        }