Click here to Skip to main content
15,913,254 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Can we read return from a process without waiting its completion? Pin
Dave Kreskowiak17-Oct-07 15:26
mveDave Kreskowiak17-Oct-07 15:26 
GeneralRe: Can we read return from a process without waiting its completion? Pin
ATC18-Oct-07 6:05
ATC18-Oct-07 6:05 
GeneralRe: Can we read return from a process without waiting its completion? Pin
svanwass18-Oct-07 9:09
svanwass18-Oct-07 9:09 
GeneralRe: Can we read return from a process without waiting its completion? Pin
Dave Kreskowiak18-Oct-07 12:09
mveDave Kreskowiak18-Oct-07 12:09 
AnswerRe: Can we read return from a process without waiting its completion? Pin
Luc Pattyn17-Oct-07 15:38
sitebuilderLuc Pattyn17-Oct-07 15:38 
GeneralRe: Can we read return from a process without waiting its completion? Pin
ATC18-Oct-07 6:06
ATC18-Oct-07 6:06 
QuestionPerforming drag and drop between two datagridviews? Pin
Mr Oizo17-Oct-07 7:19
Mr Oizo17-Oct-07 7:19 
AnswerRe: Performing drag and drop between two datagridviews? Pin
Dave Kreskowiak17-Oct-07 14:21
mveDave Kreskowiak17-Oct-07 14:21 
Drag and drop isn't exactly the easiest thing to understand. Newbie's to it get really confused about which side is supposed to be handling what, what Effects are, how to get the data out of the event args, what Data Formats are, how data is even represented in the operation. In your case, your doing it all inside your own app.

Learn the basics of drag and drop first before you start applying it to your DGV's and posting up DataGridRows into the operation. Start with creating a ListView that is a drop target and can take files dragged to it. Drop a ListView on a form and enable it's AllowDrop property.
Private Sub ListView1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles ListView1.DragDrop
    If e.AllowedEffect And DragDropEffects.Copy = DragDropEffects.Copy Or _
        e.AllowedEffect And DragDropEffects.Move = DragDropEffects.Move Then
        Dim items As String() = DirectCast(e.Data.GetData(DataFormats.FileDrop, True), String())
        For Each item As String In items
            Dim lvItem As New ListViewItem(item)
            ListView1.Items.Add(item)
        Next
    End If
End Sub

This is just the Drop side of a Drag and Drop. Once you completely understand every line of this code, you can start experimenting with starting your own Drag.

Why all this step-by-step crap?? Because it's what confuses everyone who starts out. They can't keep the two sides of a Drag and Drop straight in their head, and therefore can't keep it straight in their code either.





A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


QuestionButton with menu in outlook Pin
Koltz17-Oct-07 6:56
Koltz17-Oct-07 6:56 
Questioncatch internet explorer web site request Pin
Jamal Encami17-Oct-07 5:33
professionalJamal Encami17-Oct-07 5:33 
AnswerRe: catch internet explorer web site request Pin
Colin Angus Mackay17-Oct-07 6:12
Colin Angus Mackay17-Oct-07 6:12 
GeneralRe: catch internet explorer web site request Pin
Dave Kreskowiak17-Oct-07 6:58
mveDave Kreskowiak17-Oct-07 6:58 
AnswerRe: catch internet explorer web site request Pin
Dave Kreskowiak17-Oct-07 6:12
mveDave Kreskowiak17-Oct-07 6:12 
AnswerRe: catch internet explorer web site request Pin
svanwass18-Oct-07 9:07
svanwass18-Oct-07 9:07 
AnswerRe: catch internet explorer web site request Pin
Jamal Encami18-Oct-07 13:10
professionalJamal Encami18-Oct-07 13:10 
Questionplease help Pin
Sonia Gupta17-Oct-07 4:25
Sonia Gupta17-Oct-07 4:25 
AnswerRe: please help Pin
Dave Kreskowiak17-Oct-07 5:15
mveDave Kreskowiak17-Oct-07 5:15 
GeneralRe: please help Pin
Colin Angus Mackay17-Oct-07 6:13
Colin Angus Mackay17-Oct-07 6:13 
AnswerRe: please help Pin
pmarfleet17-Oct-07 6:43
pmarfleet17-Oct-07 6:43 
AnswerRe: please help Pin
Christian Graus17-Oct-07 9:47
protectorChristian Graus17-Oct-07 9:47 
AnswerRe: please help Pin
Pete O'Hanlon17-Oct-07 10:04
mvePete O'Hanlon17-Oct-07 10:04 
QuestionConvert binary string to integer Pin
VFaul17-Oct-07 4:21
VFaul17-Oct-07 4:21 
AnswerRe: Convert binary string to integer Pin
Ky Nam17-Oct-07 5:08
Ky Nam17-Oct-07 5:08 
QuestionRowcount a text file and if the value is less then one, delete the file Pin
Support12317-Oct-07 3:48
Support12317-Oct-07 3:48 
QuestionRe: Rowcount a text file and if the value is less then one, delete the file Pin
Support12317-Oct-07 3:51
Support12317-Oct-07 3:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.