Solved

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

Posted on 2014-02-10
2
538 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:murbro
[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 500 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:murbro
ID: 39850455
Thanks very much
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

707 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