Ejemplo n.º 1
0
 private void m_datGridView_DragDrop(object sender, DragEventArgs e)
 {
     if (e.Data.GetDataPresent("Text"))
     {
         System.Windows.Forms.DataGridView.HitTestInfo ht = m_datGridView.HitTest(m_datGridView.PointToClient(new Point(e.X, e.Y)).X, m_datGridView.PointToClient(new Point(e.X, e.Y)).Y);
         //  System.Windows.Forms.DataGridView.HitTestInfo ht = dataGridView1.HitTest(e.X,e.Y);
         if (ht.RowIndex == -1 || ht.ColumnIndex == -1)
         {
             return;
         }
         //else
         //{
         //    m_datGridView.Rows[ht.RowIndex].Cells[ht.ColumnIndex].Value = (string)e.Data.GetData("Text");
         //    MessageBox.Show(ht.RowIndex.ToString(), ht.ColumnIndex.ToString());
         //}
         if (((clsContorlMedWinQueue)this.objController).m_JudgeIsOldData(dndMouseDownRow, dndMouseDownCol))//判断是否是旧数据
         {
             return;
         }
         else
         {
             ((clsContorlMedWinQueue)this.objController).m_DropData(dndMouseDownRow, dndMouseDownCol, ht.RowIndex, ht.ColumnIndex);
         }
     }
 }
Ejemplo n.º 2
0
        void dataGridView1_MouseDown(object sender, MouseEventArgs e)
        {
            System.Windows.Forms.DataGridView.HitTestInfo info = DataGridView.HitTest(e.X, e.Y);
            if (e.Button == MouseButtons.Left)
            {
                if (info.Type == DataGridViewHitTestType.None)
                {
                    // None znaci da nije kliknut ni Cell, ni ColumnHeader, ni RowHeader, ni HorizontalScrollBar, ni
                    // VerticalScrollBar.
                    clearSelection();
                }
            }
            else if (e.Button == MouseButtons.Right)
            {
                // TODO: Ovaj deo je ranije bio u eventu CellMouseDown zato sto MouseDown event ne daje informacije o
                // RowIndex. Medjutim ova informacija (i jos ponesto) moze da se sazna pozivanjem
                // DataGridView.HitTest(e.X, e.Y). Probaj i na ostalim mestima da CellMouseDown zamenis sa MouseDown.

                if (info.Type == DataGridViewHitTestType.Cell)
                {
                    if (info.RowIndex >= 0 && !DataGridView.Rows[info.RowIndex].Selected)
                    {
                        // selektuj vrstu
                        clearSelection();
                        DataGridView.Rows[info.RowIndex].Selected = true;
                    }
                }
            }
        }
Ejemplo n.º 3
0
        private void grdContrato_DragDrop(object sender, DragEventArgs e)
        {
            AssociacaoPsa regAssociacaoPsa = e.Data.GetData(typeof(AssociacaoPsa)) as AssociacaoPsa;
            Point         cursorLocation   = grdContrato.PointToClient(new Point(e.X, e.Y));

            System.Windows.Forms.DataGridView.HitTestInfo hittest = grdContrato.HitTest(cursorLocation.X, cursorLocation.Y);
            if (hittest.ColumnIndex != -1 && hittest.RowIndex != -1)
            {
                if (string.IsNullOrEmpty(regAssociacaoPsa.acompanhamentoContrato))
                {
                    Boolean associou = false;
                    regAssociacaoPsa.contratoErpId     = (int)grdContrato.Rows[hittest.RowIndex].Cells["contratoErpId"].Value;
                    regAssociacaoPsa.itemContratoErpId = (int)grdContrato.Rows[hittest.RowIndex].Cells["itemContratoErpId"].Value;
                    associou = objNeg.Associar_Contrato_ItemContrato_Acompanhamento_Medicao(strDir, regAssociacaoPsa);
                    grdPsa.CurrentRow.Cells["contratoErpId"].Value     = regAssociacaoPsa.contratoErpId;
                    grdPsa.CurrentRow.Cells["itemContratoErpId"].Value = regAssociacaoPsa.itemContratoErpId;
                    if (associou)
                    {
                        MessageBox.Show("Associação realizada com sucesso!");
                    }
                }
                else
                {
                    MessageBox.Show("Já existe Acompanhamento de Contrato para esse item de PSA!");
                }
            }
        }
Ejemplo n.º 4
0
        private void dgvSessionInfo_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                _hit = dgvSessionInfo.HitTest(e.X, e.Y);
                ContextMenu m = new ContextMenu();
                if (_hit.ColumnIndex < 0)
                {
                    m.MenuItems.Add(new MenuItem("Clear filters", new EventHandler(this.ClearFilters)));
                }
                else
                {
                    switch (_table.Columns[_hit.ColumnIndex].ColumnName)
                    {
                    case "SessionID":
                        m.MenuItems.Add(new MenuItem("Filter only this session ID", new EventHandler(this.FilterSessions)));
                        m.MenuItems.Add(new MenuItem("Clear filters", new EventHandler(this.ClearFilters)));
                        break;

                    case "Timestamp":
                        m.MenuItems.Add(new MenuItem("Filter only this timestamp", new EventHandler(this.FilterTimestamp)));
                        m.MenuItems.Add(new MenuItem("Filter before date", new EventHandler(this.FilterTimestampBefore)));
                        m.MenuItems.Add(new MenuItem("Filter after date", new EventHandler(this.FilterTimestampAfter)));
                        m.MenuItems.Add(new MenuItem("Clear filters", new EventHandler(this.ClearFilters)));
                        break;

                    case "MsgLevel":
                        m.MenuItems.Add(new MenuItem("Filter only this message level", new EventHandler(this.FilterMsgLevel)));
                        m.MenuItems.Add(new MenuItem("Clear filters", new EventHandler(this.ClearFilters)));
                        break;

                    case "MsgNum":
                        m.MenuItems.Add(new MenuItem("Filter only this message number", new EventHandler(this.FilterMsgNum)));
                        m.MenuItems.Add(new MenuItem("Clear filters", new EventHandler(this.ClearFilters)));
                        break;

                    case "Activity":
                        m.MenuItems.Add(new MenuItem("Filter only this activity", new EventHandler(this.FilterActivity)));
                        m.MenuItems.Add(new MenuItem("Clear filters", new EventHandler(this.ClearFilters)));
                        break;

                    case "User":
                        m.MenuItems.Add(new MenuItem("Filter only this user", new EventHandler(this.FilterUser)));
                        m.MenuItems.Add(new MenuItem("Clear filters", new EventHandler(this.ClearFilters)));
                        break;

                    case "IP":
                        m.MenuItems.Add(new MenuItem("Filter only this IP", new EventHandler(this.FilterIP)));
                        m.MenuItems.Add(new MenuItem("Clear filters", new EventHandler(this.ClearFilters)));
                        break;

                    default:
                        m.MenuItems.Add(new MenuItem("Clear filters", new EventHandler(this.ClearFilters)));
                        break;
                    }
                }
                m.Show(dgvSessionInfo, new Point(e.X, e.Y));
            }
        }
 private void dgList_MouseDown(object sender, MouseEventArgs e)
 {
     System.Windows.Forms.DataGridView.HitTestInfo hit = dgList.HitTest(e.X, e.Y);
     if (hit.Type == DataGridViewHitTestType.ColumnHeader)
     {
         mSorting = true;
     }
 }
Ejemplo n.º 6
0
        private void DGV_MouseDown(object sender, MouseEventArgs e)
        {
            _DGV_MouseDown_HitTestInfo = DGV.HitTest(e.X, e.Y);

            if (e.Button == MouseButtons.Left)
            {
                _DGV_MouseDown_ButtonLeft_Location = e.Location;
            }
        }
Ejemplo n.º 7
0
        void insertRowMenuItem_Click(object sender, EventArgs e)
        {
            System.Windows.Forms.DataGridView.HitTestInfo hti = dgCodes.HitTest(clickPosition.X, clickPosition.Y);

            if (dgCodes.DataSource is DataTable)
            {
                DataTable table = (DataTable)dgCodes.DataSource;
                table.Rows.InsertAt(table.NewRow(), hti.RowIndex);
                table.AcceptChanges();
            }
        }
        /// <summary>
        /// dataGridView1 鼠标的按下事件的处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dataGridView1_MouseDown(object sender, MouseEventArgs e)
        {
            System.Windows.Forms.DataGridView.HitTestInfo hti = dataGridView1.HitTest(e.X, e.Y);
            if ((e.Button == MouseButtons.Right) && (hti.Type == DataGridViewHitTestType.RowHeader))
            {
                ContextMenuStrip contextMenuStrip1 = new ContextMenuStrip();
                contextMenuStrip1.Items.Add("添加");
                contextMenuStrip1.Items.Add("删除");
                contextMenuStrip1.Show(MousePosition.X, MousePosition.Y);

                contextMenuStrip1.ItemClicked += new ToolStripItemClickedEventHandler(contextMenuStrip1_ItemClicked);
            }
        }
Ejemplo n.º 9
0
        private void UnleashedData_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            System.Windows.Forms.DataGridView.HitTestInfo testInfo = UnleashedData.HitTest(e.X, e.Y);

            //Need to check to make sure that the row index is 0 or greater as the first
            //row is a zero and where there is no rows the row index is a -1
            if (testInfo.RowIndex >= 0 && testInfo.RowIndex != previousRow)
            {
                //UnleashedData.Rows[previousRow].Selected = false;
                //UnleashedData.Rows[testInfo.RowIndex].Selected = true;
                //previousRow = testInfo.RowIndex;
                //UnleashedData.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.Blue;
            }
        }
Ejemplo n.º 10
0
        private void m_datGridView_DragOver(object sender, DragEventArgs e)
        {
            System.Windows.Forms.DataGridView.HitTestInfo ht = m_datGridView.HitTest(m_datGridView.PointToClient(new Point(e.X, e.Y)).X, m_datGridView.PointToClient(new Point(e.X, e.Y)).Y);
            // System.Windows.Forms.DataGridView.HitTestInfo ht = dataGridView1.HitTest(e.X,e.Y);
            //Console.WriteLine(ht.ToString());
            if ((ht.RowIndex == this.dndMouseDownRow && ht.ColumnIndex == this.dndMouseDownCol) ||
                !e.Data.GetDataPresent("Text"))
            {
                e.Effect = DragDropEffects.None;
            }
            else
            {
                e.Effect = DragDropEffects.Move;

                m_datGridView.Rows[ht.RowIndex].Cells[ht.ColumnIndex].Selected = true;
            }
        }
Ejemplo n.º 11
0
    protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e)
    {
        bDragging = false;
        HitTestInfo livehti = hti;

        hti = null;
        if (RowDropped != null &&
            livehti != null &&
            livehti.RowIndex != -1 &&
            this.CurrentRow.Index != livehti.RowIndex)
        {
            RowDropped(this, this.CurrentRow, this.Rows[livehti.RowIndex]);
        }
        StopAutoScrolling();
        Invalidate();
        base.OnMouseUp(e);
    }
Ejemplo n.º 12
0
        private void cimGrid_MouseClick(object sender, MouseEventArgs e)
        {
            System.Windows.Forms.DataGridView.HitTestInfo hitTest = cimGrid.HitTest(e.X, e.Y);

            if (hitTest.Type == DataGridViewHitTestType.Cell)
            {
                if (!((DataGridViewRow)(cimGrid.Rows[hitTest.RowIndex])).Selected)
                {
                    cimGrid.ClearSelection();

                    ((DataGridViewRow)cimGrid.Rows[hitTest.RowIndex]).Selected = true;
                }

                CimVariacio ma = (CimVariacio)cimGrid[0, hitTest.RowIndex].Value;
                ShowInfo(ma.Id);

                if (e.Button == MouseButtons.Right)
                {
                    errorStrip.Show(cimGrid.PointToScreen(e.Location));
                }
            }
        }
Ejemplo n.º 13
0
        private void dataGridView1_MouseDown(object sender, MouseEventArgs e)
        {
            System.Windows.Forms.DataGridView.HitTestInfo hti = dataGridView1.HitTest(e.X, e.Y);

            if (hti.ColumnIndex == -1 && hti.RowIndex >= 0)
            {
                // row header click
                if (dataGridView1.SelectionMode != DataGridViewSelectionMode.RowHeaderSelect)
                {
                    dataGridView1.SelectionMode = DataGridViewSelectionMode.RowHeaderSelect;
                }
            }

            else if (hti.RowIndex == -1 && hti.ColumnIndex >= 0)
            {
                // column header click
                if (dataGridView1.SelectionMode != DataGridViewSelectionMode.ColumnHeaderSelect)
                {
                    dataGridView1.SelectionMode = DataGridViewSelectionMode.ColumnHeaderSelect;
                }
            }
        }
Ejemplo n.º 14
0
 protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e)
 {
     if (bDragging && e.Button == MouseButtons.Left)
     {
         DataGridView.HitTestInfo newhti = this.HitTest(e.X, e.Y);
         if (hti != null && hti.RowIndex != newhti.RowIndex)
         {
             System.Diagnostics.Debug.WriteLine("invalidating " + hti.RowIndex.ToString());
             Invalidate();
         }
         hti = newhti;
         System.Diagnostics.Debug.WriteLine(string.Format("{0:000} {1}  ", hti.RowIndex, e.Location));
         Point clientPoint = this.PointToClient(e.Location);
         System.Diagnostics.Debug.WriteLine(e.Location + "  " + this.Bounds.Size);
         if (scrollTimer == null &&
             ShouldScrollDown(e.Location))
         {
             //
             // enable the timer to scroll the screen
             //
             scrollTimer = new System.Threading.Timer(new System.Threading.TimerCallback(TimerScroll), 1, 0, 250);
         }
         if (scrollTimer == null &&
             ShouldScrollUp(e.Location))
         {
             scrollTimer = new System.Threading.Timer(new System.Threading.TimerCallback(TimerScroll), -1, 0, 250);
         }
     }
     else
     {
         bDragging = false;
     }
     if (!(ShouldScrollUp(e.Location) || ShouldScrollDown(e.Location)))
     {
         StopAutoScrolling();
     }
     base.OnMouseMove(e);
 }
Ejemplo n.º 15
0
        private void m_datGridView_MouseMove(object sender, MouseEventArgs e)
        {
            //  System.Windows.Forms.DataGridView.HitTestInfo ht = m_datGridView.HitTest(m_datGridView.PointToClient(new Point(e.X, e.Y)).X, m_datGridView.PointToClient(new Point(e.X, e.Y)).Y);

            System.Windows.Forms.DataGridView.HitTestInfo ht = m_datGridView.HitTest(e.X, e.Y);
            if (e.Button == MouseButtons.Left)
            {
                if (dndMouseDownRow == -1 || dndMouseDownCol == -1 ||
                    (ht.RowIndex == dndMouseDownRow && ht.ColumnIndex == dndMouseDownCol))
                {
                    return;
                }
                if (m_datGridView.Rows[this.dndMouseDownRow].Cells[dndMouseDownCol].Value.ToString() == "")
                {
                    return;
                }
                String data = m_datGridView.Rows[this.dndMouseDownRow].Cells[dndMouseDownCol].Value.ToString();
                this.DoDragDrop(data, DragDropEffects.Move);

                this.dndMouseDownRow = -1;
                this.dndMouseDownCol = -1;
            }
        }
Ejemplo n.º 16
0
        void removeColumnMenuItem_Click(object sender, EventArgs e)
        {
            System.Windows.Forms.DataGridView.HitTestInfo hti = dgCodes.HitTest(clickPosition.X, clickPosition.Y);

            if (dgCodes.DataSource is DataTable)
            {
                DataTable table       = (DataTable)dgCodes.DataSource;
                int       columnCount = table.Columns.Count;

                if (hti.ColumnIndex >= 0 && hti.ColumnIndex < columnCount)
                {
                    DialogResult result = MessageBox.Show(
                        string.Format("Select OK to delete the column named '{0}' from this table.", table.Columns[hti.ColumnIndex].ColumnName),
                        "Delete Column",
                        MessageBoxButtons.OKCancel);

                    if (result == DialogResult.OK)
                    {
                        table.Columns.RemoveAt(hti.ColumnIndex);
                        table.AcceptChanges();
                    }
                }
            }
        }
Ejemplo n.º 17
0
        public static void loadPictureInPictureBox(System.Windows.Forms.MouseEventArgs e, System.Windows.Forms.Panel WorkPanel)
        {
            System.Windows.Forms.DataGridView dgv = ((System.Windows.Forms.DataGridView)WorkPanel.Controls.Find("dataGridView1", true)[0]);

            if (dgv.Name == "dataGridView1")
            {

                     hitTest = dgv.HitTest(e.X, e.Y);

                     if (hitTest.RowIndex >= 0)
                     {
                             System.Windows.Forms.PictureBox pictureBox1 = ((System.Windows.Forms.PictureBox)WorkPanel.Controls.Find("pictureBox1", true)[0]);

                            object pic = SQLOracle.getBlobImageWithBuffer("SELECT DET FROM DB_DATA WHERE NAME = :NAME AND GOST = :GOST AND OBOZN = :OBOZN ", dgv[0, hitTest.RowIndex].Value.ToString(), dgv[2, hitTest.RowIndex].Value.ToString(), dgv[1, hitTest.RowIndex].Value.ToString());
                            if (pic != null)
                            {
                                pictureBox1.Image = (Image)pic;
                                pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
                            }
                                else
                            {
                                pictureBox1.Image = UchetUSP.Properties.Resources.delete_16x16;
                                pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
                            }

                     }

            }
        }
Ejemplo n.º 18
0
        private void ComparisonsDGV_MouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                System.Windows.Forms.DataGridView.HitTestInfo hit = ComparisonsDGV.HitTest(e.X, e.Y);

                if (hit.Type == DataGridViewHitTestType.Cell && hit.ColumnIndex != _left.Entities[0].Properties.Count)
                {
                    DataGridViewCell cell = ComparisonsDGV.Rows[hit.RowIndex].Cells[hit.ColumnIndex];

                    associateWithToolStripMenuItem.DropDownItems.Clear();
                    removeAssociationWithToolStripMenuItem.DropDownItems.Clear();
                    transferToolStripMenuItem.DropDownItems.Clear();

                    bool left = hit.ColumnIndex < _left.Entities[0].Properties.Count;
                    _currentEntity = _comp.GetEntity((string)ComparisonsDGV.Rows[hit.RowIndex].Cells[left ? 0 : _left.Entities[0].Properties.Count + 1].Value, left);
                    if (_currentEntity == null)
                    {
                        return;
                    }

                    List <string> entitiesList = new List <string>();
                    _currentEntities = new List <DataEntity>()
                    {
                        _currentEntity
                    };
                    string currentProperty = _left.Entities[0].Properties[left ? hit.ColumnIndex : (hit.ColumnIndex - 1 - _left.Entities[0].Properties.Count)].Name;
                    _currentProperties = new List <string>()
                    {
                        currentProperty
                    };

                    entitiesList.Add((string)_currentEntity.Properties[0].Value);

                    foreach (DataGridViewCell curCell in ComparisonsDGV.SelectedCells)
                    {
                        if ((left && curCell.ColumnIndex < _left.Entities[0].Properties.Count) || (!left && curCell.ColumnIndex > _left.Entities[0].Properties.Count))
                        {
                            DataEntity entity = _comp.GetEntity((string)ComparisonsDGV.Rows[curCell.RowIndex].Cells[left ? 0 : _left.Entities[0].Properties.Count + 1].Value, left);
                            if (!_currentEntities.Contains(entity))
                            {
                                _currentEntities.Add(entity);
                                entitiesList.Add((string)entity.Properties[0].Value);
                            }
                            string propName = _left.Entities[0].Properties[left ? curCell.ColumnIndex : (curCell.ColumnIndex - 1 - _left.Entities[0].Properties.Count)].Name;
                            if (!_currentProperties.Contains(propName))
                            {
                                _currentProperties.Add(propName);
                            }
                        }
                    }

                    Logger.Log(TypesHelper.Join(entitiesList) + " " + TypesHelper.Join(_currentProperties), LogSeverities.Info);

                    string[] confirmedAssocs = _comp.GetConfirmedAssociations(_currentEntity.Id, left);
                    foreach (string assoc in confirmedAssocs)
                    {
                        removeAssociationWithToolStripMenuItem.DropDownItems.Add(assoc, null, new EventHandler(DeAssociate_OnClick));
                    }

                    string[] assocs = _comp.GetPossibleAssociations(_currentEntity.Id, left);

                    foreach (string assoc in assocs)
                    {
                        associateWithToolStripMenuItem.DropDownItems.Add(assoc, null, new EventHandler(Associate_OnClick));
                    }

                    dontAssociateToolStripMenuItem.Checked = _currentEntity.DontAssociate;

                    toolStripMenuItem1.Visible        = false;
                    transferToolStripMenuItem.Visible = false;

                    DataEntity currentAssociatedEntity = _currentEntity.AssociatedEntity;

                    if (currentAssociatedEntity != null)
                    {
                        string[] transferables = _comp.GetTransferables(_currentEntity);

                        if (transferables.Length > 0)
                        {
                            bool canTransfer = false;

                            if (ArrayContains(transferables, currentProperty) && _comp.Comparisons[_currentEntity][currentAssociatedEntity][currentProperty] < 1.0)
                            {
                                transferToolStripMenuItem.DropDownItems.Add(currentProperty, null, new EventHandler(Transfer_OnClick));
                                transferToolStripMenuItem.DropDownItems.Add("-", null, null);
                                transferToolStripMenuItem.DropDownItems.Add("All sel. props (" + TypesHelper.Join(_currentProperties) + ")", null, new EventHandler(Transfer_OnClick));
                                transferToolStripMenuItem.DropDownItems.Add("-", null, null);
                                transferToolStripMenuItem.DropDownItems.Add("All", null, new EventHandler(TransferAll_OnClick));

                                canTransfer = true;
                            }
                            else
                            {
                                foreach (string transferable in transferables)
                                {
                                    foreach (DataEntity currentEntity in _currentEntities)
                                    {
                                        if (_comp.Comparisons[currentEntity][currentEntity.AssociatedEntity][transferable] < 1.0)
                                        {
                                            transferToolStripMenuItem.DropDownItems.Add("All sel. props (" + TypesHelper.Join(_currentProperties) + ")", null, new EventHandler(Transfer_OnClick));
                                            transferToolStripMenuItem.DropDownItems.Add("-", null, null);
                                            transferToolStripMenuItem.DropDownItems.Add("All", null, new EventHandler(TransferAll_OnClick));
                                            canTransfer = true;
                                            break;
                                        }
                                    }
                                    if (canTransfer)
                                    {
                                        break;
                                    }
                                }
                            }

                            if (canTransfer)
                            {
                                toolStripMenuItem1.Visible        = true;
                                transferToolStripMenuItem.Visible = true;
                            }
                        }
                    }

                    comparisonCtxt.Show(ComparisonsDGV.PointToScreen(new Point(e.X, e.Y)));
                }
            }
        }
Ejemplo n.º 19
0
        protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e)
        {
            if (bDragging && e.Button == MouseButtons.Left)
            {
                DataGridView.HitTestInfo newhti = this.HitTest(e.X, e.Y);
                if (hti != null && hti.RowIndex != newhti.RowIndex)
                {
                    System.Diagnostics.Debug.WriteLine("invalidating " + hti.RowIndex.ToString());
                    Invalidate();
                }
                hti = newhti;
                System.Diagnostics.Debug.WriteLine(string.Format("{0:000} {1}  ", hti.RowIndex, e.Location));

                Point clientPoint = this.PointToClient(e.Location);

                System.Diagnostics.Debug.WriteLine(e.Location + "  " + this.Bounds.Size);
                if (scrollTimer == null
                && ShouldScrollDown(e.Location))
                {
                    //
                    // enable the timer to scroll the screen
                    //
                    scrollTimer = new System.Threading.Timer(new System.Threading.TimerCallback(TimerScroll), 1, 0, 250);
                    //    System.Diagnostics.Debug.WriteLine(" scrollTimer Down " + scrollTimer.ToString());
                }

                //                System.Diagnostics.Debug.WriteLine(" scrollTimer UP check " + ShouldScrollUp(e.Location).ToString());
                try
                {
                    if (scrollTimer == null
                    && ShouldScrollUp(e.Location))
                    {
                        scrollTimer = new System.Threading.Timer(new System.Threading.TimerCallback(TimerScroll), -1, 0, 250);
                        //    System.Diagnostics.Debug.WriteLine(" scrollTimer UP " + scrollTimer.ToString());
                    }
                }
                catch (Exception eup)
                {
                    System.Diagnostics.Debug.WriteLine(eup.Message + eup.InnerException);
                }

            }
            else
            {
                bDragging = false;
            }

            if (!(ShouldScrollUp(e.Location) || ShouldScrollDown(e.Location)))
            {
                StopAutoScrolling();
            }
            base.OnMouseMove(e);
        }
Ejemplo n.º 20
0
        protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e)
        {
            bDragging = false;
            HitTestInfo livehti = hti;
            hti = null;

            if (RowDropped != null
             && livehti != null
             && livehti.RowIndex != -1
             && this.CurrentRow.Index != livehti.RowIndex)
            {
                RowDropped(this, this.CurrentRow, this.Rows[livehti.RowIndex]);
            }
            StopAutoScrolling();

            Invalidate();
            base.OnMouseUp(e);
        }
Ejemplo n.º 21
0
 private void m_datGridView_MouseDown(object sender, MouseEventArgs e)
 {
     System.Windows.Forms.DataGridView.HitTestInfo ht = m_datGridView.HitTest(e.X, e.Y);
     this.dndMouseDownRow = ht.RowIndex;
     this.dndMouseDownCol = ht.ColumnIndex;
 }