private declare sub dragacceptfiles lib "shell32.dll" (byval hwnd as int32, byval faccept as int32) private declare sub dragfinish lib "shell32.dll" (byval hdrop as int32) private declare function dragqueryfile lib "shell32.dll" alias "dragqueryfilea" (byval hdrop as int32, byval uint as int32, byval lpstr as
protected overrides sub wndproc(byref m as system.windows.forms.message) if m.msg = wm_dropfiles then dragfiles(m.wparam.toint32) exit sub end if mybase.wndproc(m) end sub
private sub dragfiles(byval hdrop as int32) dim ireturn as int32 dim sfile as string sfile = space(max_length) ireturn = dragqueryfile(hdrop, 0, sfile, max_length) if ireturn then textbox3.text = sfile picturebox1.image = image.fromfile(trim(textbox3.text)) dragfinish(hdrop) end if end sub