In the following example, a ListBox onDragEnter is used to determine whether or not a drop will be allowed:

function LISTBOX1_onDragEnter(nLeft, nTop, cType, cName)

 nReturn = 0       // Default is no drop

 if cType == “F”     // Test for file being dragged

  try         // (in case cName is not char)

   if file( cName )  // See if file exists

    nReturn = 1    // Drop will be allowed

   endIf

  catch ( Exception e )

   // (Ignore error)

  endTry

 endIf

 return nReturn