LPARAMETERS oDataObject, nEffect, nButton, nShift, nXCoord, nYCoord, nState IF nState == 0 && Drag Enter IF oDataObject.GetFormat( 15 ) && Files * I can handle drops of files This.OLEDropHasData = 1 This.OLEDropEffects = 1 ENDCASE ENDIFAnd the drag and drop event
LPARAMETERS oDataObject, nEffect, nButton, nShift, nXCoord, nYCoord LOCAL aFiles[ 1 ], nFiles, i, cExt IF oDataObject.GetFormat( 15 ) * I can handle file data * Get the file data into an array IF oDataObject.GetData( 15, @aFiles ) * If we got any set the count nFiles = alen( aFiles, 1 ) ELSE * Set the count to 0 nFiles = 0 ENDIF * Check each of the files FOR i = 1 to nFiles * Get the extension cExt = Upper( JustExt( aFiles[ i ] )) IF ( cExt == "BMP" ) or ( cExt == "JPG" ) or ( cExt == "GIF" ) * If it is a file we can handle * Hide the label This.lblDropSpace.Visible = .F. * Set the picture property This.Picture = aFiles[ i ] * Draw he container THIS.Draw * Pause for a few seconds in case there was more than one file INKEY(2,"H") ENDIF ENDFOR * Set the copy only attribute nEffect = 1 * stop the default action of this drag and drop NODEFAULT ENDIF