Results 1 to 2 of 2

Thread: How to accurately locate pop up form besides a cell

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2008
    Posts
    110

    How to accurately locate pop up form besides a cell

    When mouse enters a cell, I need to pop up a form just besides the cell, like, the top left of the form is at the bottom right of the form.

    But the following code doesn't work, where the form appear radomly..

    How to do it right?

    vb.NET Code:
    1. Private Sub m_dgvBasicDataGrid_CellMouseEnter(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles m_dgvBasicDataGrid.CellMouseEnter
    2.      Dim pt As System.Drawing.Point
    3. Dim rect As Rectangle = m_dgvBasicDataGrid.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, True)
    4. pt = New System.Drawing.Point(rect.Right, rect.Bottom)
    5.  
    6.  Form2.Location = pt
    7. Form2.Visible = True
    8. End Sub

  2. #2
    New Member
    Join Date
    Jul 2008
    Posts
    5

    Re: How to accurately locate pop up form besides a cell

    Make sure the form's 'StartPosition' property is set to 'Manual'.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width