Here's a few things to fix first:
- add
Option Strict On and
Option Explicit On lines at the beginning of vb-file
- line 19: you refer to draggedlabel but you haven't declared it. Is it a label control in the form?
- line 22: sender is of type Object which does not have Text property and thus
serverref = sender.text does not work. You have to cast sender to correct type first. If it's a label, use
serverref = CType(sender, Label).Text
- line 44: should be
If e.Button = Windows.Forms.MouseButtons.Left Then
- lines 57 and 60: cast sender object to correct type, like
CType(sender, Label)
Simply fixing these type issues may solve your problem. I don't remember seeing an app that prompts a message box at DragEnter event but without actually testing it, I don't see any reason why it shouldn't work. In general I would personally take away that confirmation. If the user has an opportunity to drag&drop something, he/she usually knows what he/she is doing
HTH
Last edited by Teme64; Aug 1st, 2009 at 6:35 am. Reason: Pressed submit by mistake :)
Reputation Points: 218
Solved Threads: 201
Veteran Poster
Offline 1,024 posts
since Aug 2008