I'm using the following function to OLEdrag and drop picture files(filenames) from the desktop or Windows Explorer into a picturebox:
Private Sub Picture1_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture1.Picture = LoadPicture(Data.Files(1))
When the file dropped isn't a valid picturebox format, I receive the Invalid Picture error. Can anyone complete my code so that any file with invalid format is rejected from being dropped?