Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Capturing Drag-drop onto _Screen with Bindevents
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00830854
Message ID:
00830905
Vues:
15
Nevermind I found a way to do it. From VFP help. I had no idea that you could hook events from other objects within a class definition the way this example shows. I still don't really understand why you can get away with it.
* For VFP6 & 7:
*
     _SCREEN.NewObject("oSH","ScreenHook","screenmethods.prg")
*
* For VFP3 & 5:
*
*     SET PROCEDURE TO screenmethods ADDITIVE
*     _SCREEN.AddObject("oSH","ScreenHook")
*
* Any of the main VFP screen methods can be hooked into in this manner.
*
DEFINE CLASS ScreenHook AS CUSTOM
 oScr = _SCREEN
 PROCEDURE oScr.RESIZE()
  *
  * Code to handle the main VFP screen being resized
  *
  WAIT WINDOW NOWAIT TRANSFORM(THIS.WIDTH)+" "+TRANSFORM(THIS.HEIGHT)
 ENDPROC
 PROCEDURE oScr.moved()
  *
  * Code to handle the main VFP screen being resized
  *
  WAIT WINDOW NOWAIT "moved"
 ENDPROC
 PROCEDURE oScr.RIGHTCLICK
  *
  * Code to do a "shortcut" menu on main VFP screen RightClick
  *
  * DO ..\menus\testmenu.mpr
 ENDPROC
 *
 * Custom methods work, too.
 *
 PROCEDURE oScr.MyMethod
  WAIT WINDOW "my method fired!"
 ENDPROC
ENDDEFINE
>I want to capture a drag-drop event when an object is drag-dropped onto _screen. Has anybody had success with using Bindevents() in conjunction with the OleDragOver and OleDragDrop events for _screen? I experimented with it and could not get it to work. It's like VFP just ignores the dragover when I actually drag an object over the VFP main window. Never actually generates an event even though Intellisense indicates that _screen has such an event. Thanks!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform