?
Solved

VB.net open Windows Form at point on DataGridView drag drop

Posted on 2014-02-10
2
Medium Priority
?
543 Views
Last Modified: 2014-02-11
Hi

I am opening a Windows form in the DragDrop event over a DataGridView. I have done a hit test. How do I open the form at the point where the drag drop occurs using this information?


  Private Sub DataGridView1_DragDrop(sender As Object, e As System.Windows.Forms.DragEventArgs) Handles DataGridView1.DragDrop
        Try
            Dim oCellAddress As String

            '** NOTE - Find X and Y coorinates or Row and Column index: so can drag into an individual cell or a row
            '   The following code puts whatever text is sent into the destination cell
            Dim p As Point = Me.DataGridView1.PointToClient(New Point(e.X, e.Y))
            Dim hitTest As DataGridView.HitTestInfo = DataGridView1.HitTest(p.X, p.Y)
            Dim oRowIndex As Integer = hitTest.RowIndex
            Dim oColumnIndex As Integer = hitTest.ColumnIndex

              Dim Form_PickQuery As New frmPickQuery
            Form_PickQuery.Show(
0
Comment
Question by:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 25

Accepted Solution

by:
Luis Pérez earned 2000 total points
ID: 39850145
What you need to do is:

Dim Form_PickQuery As New frmPickQuery
Form_PickQuery.StartPosition = FormStartPosition.Manual
Form_PickQuery.Left = e.X
Form_PickQuery.Top = e.Y
Form_PickQuery.Show()

Open in new window


Hope that helps.
0
 

Author Closing Comment

by:Murray Brown
ID: 39850455
Thanks very much
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month9 days, 8 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question