Ctrl键监听事件

Ctrl键属性

Ctrl键监听事件_第1张图片

 /// 
        /// 记录是否按下Ctrl键
        /// 
        /// 
        /// 
        private void FrmTSMain_KeyDown(object sender, KeyEventArgs e)
        {//增加 jiangb 20160921
            try
            {
                if (e.Control)
                {
                    blPressCtrl = true;
                }
            }
            catch (Exception ex)
            {
                UserMessages.ShowInfoBox(ex.Message);
            }
        }

if (blPressCtrl)
                {//增加判断是否按下Ctrl,按下Ctrl则认为走多选逻辑  jiangb 20160921
                    #region//meng 2016-9-12 多选交工逻辑
                    //int[] iSelect = gridViewCraftPlan.GetSelectedRows();
                    //DevExpress.XtraGrid.Views.Base.GridCell[] SelectedCell = gridViewCraftPlan.GetSelectedCells();
                    //增加组合调试判断
                    int[] iSelect = null;
                    DevExpress.XtraGrid.Views.Base.GridCell[] SelectedCell = null;
                    iSelect = gridViewCraftPlan.GetSelectedRows();
                    SelectedCell = gridViewCraftPlan.GetSelectedCells();
                    #region --验证循环
                    if (SelectedCell.Length == iSelect.Length)
                    {

你可能感兴趣的:(C#)