Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Moving Container
Message
De
24/09/2003 23:51:42
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
 
 
À
24/09/2003 16:27:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00832008
Message ID:
00832083
Vues:
17
>If the have a container on my form, is there a way to code it to make it movable just like other dialogue box? Could it be done? Any help or suggestions is appreciated.

Here's a sample you can play with:
o1 = createobject( "myform" )
o1.windowstate = 2
o1.show()

read events

define class myform as form
   nx = 0
   ny = 0

   add object con1 as container with dragmode = 0

procedure con1.mousedown
   lparameters nButton, nShift, nX, nY

   thisform.nx = nx
   thisform.ny = ny

   this.Drag( 1 )

procedure dragover
   lparameters oSource, nX, nY, nState

   wait window nowait at 10, 10 ;
      "state:" + transform( nstate ) + ;
      " x:" + transform( nX ) + ;
      " y:" + transform( nY )

procedure dragdrop
   lparameters oSource, nX, nY

   oSource.Drag( 2 )
   oSource.Left = oSource.Left + nX - thisform.nx
   oSource.Top  = oSource.Top  + nY - thisform.ny

procedure queryunload
   clear events
enddefine
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform