Click here to Skip to main content
15,911,531 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionDrag&Drop problem Pin
The real $M@5-Jul-09 0:17
The real $M@5-Jul-09 0:17 
Hi I'm writing a program that has a ListBox control. If the user drags a file and drops it on the listbox, the filename should be added to the list. I'm using the following code:

Private Sub ListBox1_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles ListBox1.DragEnter
   If e.Data.GetDataPresent(DataFormats.FileDrop) Then
      e.Effect = DragDropEffects.Copy
   Else
      e.Effect = DragDropEffects.None
   End If
End Sub

Private Sub ListBox1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles ListBox1.DragDrop
   Stop 'This is called
   Dim s$ = e.Data.GetData(DataFormats.FileDrop, True) 'Why does this exit the sub?
   Stop 'This not
   '...
End Sub


As you can see, I put 2 stop statements in the DragDrop event. The first of them is called and stops debugging, but then e.data.getdata somehow exits the sub, and so nothing happens.
Is it even possible that a procedure exits the sub it is called from (without exiting the thread)???

I'm very confused Confused | :confused: ; I would be grateful to anyone who could give me an explanation for this.
AnswerRe: Drag&Drop problem Pin
Mycroft Holmes5-Jul-09 2:14
professionalMycroft Holmes5-Jul-09 2:14 
GeneralRe: Drag&Drop problem Pin
Henry Minute5-Jul-09 4:18
Henry Minute5-Jul-09 4:18 
GeneralRe: Drag&Drop problem Pin
Mycroft Holmes5-Jul-09 14:10
professionalMycroft Holmes5-Jul-09 14:10 
AnswerRe: Drag&Drop problem Pin
Alan N5-Jul-09 4:05
Alan N5-Jul-09 4:05 
GeneralRe: Drag&Drop problem Pin
The real $M@5-Jul-09 22:04
The real $M@5-Jul-09 22:04 
QuestionAccess Database Path using vb.net[modified] Pin
mirzamujib4-Jul-09 23:09
mirzamujib4-Jul-09 23:09 
AnswerRe: Access Database Path using vb.ne Pin
dan!sh 5-Jul-09 2:30
professional dan!sh 5-Jul-09 2:30 
GeneralRe: Access Database Path using vb.ne Pin
mirzamujib5-Jul-09 3:58
mirzamujib5-Jul-09 3:58 
GeneralRe: Access Database Path using vb.ne Pin
dan!sh 5-Jul-09 5:19
professional dan!sh 5-Jul-09 5:19 
GeneralRe: Access Database Path using vb.ne Pin
JC.KaNNaN5-Jul-09 19:36
JC.KaNNaN5-Jul-09 19:36 
GeneralRe: Access Database Path using vb.ne Pin
mirzamujib6-Jul-09 1:29
mirzamujib6-Jul-09 1:29 
GeneralRe: Access Database Path using vb.ne Pin
mirzamujib6-Jul-09 0:25
mirzamujib6-Jul-09 0:25 
QuestionAdding effects in image Pin
Gagan.204-Jul-09 3:41
Gagan.204-Jul-09 3:41 
AnswerRe: Adding effects in image Pin
Rozis4-Jul-09 11:18
Rozis4-Jul-09 11:18 
AnswerRe: Adding effects in image Pin
Christian Graus5-Jul-09 0:23
protectorChristian Graus5-Jul-09 0:23 
GeneralRe: Adding effects in image Pin
Gagan.205-Jul-09 1:50
Gagan.205-Jul-09 1:50 
GeneralRe: Adding effects in image Pin
Christian Graus5-Jul-09 1:55
protectorChristian Graus5-Jul-09 1:55 
GeneralRe: Adding effects in image Pin
Gagan.205-Jul-09 1:59
Gagan.205-Jul-09 1:59 
Questionwhat is Using keyword in VB.net ? Pin
xingselex4-Jul-09 1:11
xingselex4-Jul-09 1:11 
AnswerRe: what is Using keyword in VB.net ? Pin
0x3c04-Jul-09 1:39
0x3c04-Jul-09 1:39 
GeneralRe: what is Using keyword in VB.net ? Pin
Colin Angus Mackay4-Jul-09 2:29
Colin Angus Mackay4-Jul-09 2:29 
GeneralRe: what is Using keyword in VB.net ? Pin
0x3c04-Jul-09 3:44
0x3c04-Jul-09 3:44 
AnswerRe: what is Using keyword in VB.net ? Pin
Anubhava Dimri4-Jul-09 1:40
Anubhava Dimri4-Jul-09 1:40 
GeneralRe: what is Using keyword in VB.net ? Pin
Colin Angus Mackay4-Jul-09 2:30
Colin Angus Mackay4-Jul-09 2:30 

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.