Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Moving Container
Message
From
24/09/2003 23:51:42
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
 
 
To
24/09/2003 16:27:00
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00832008
Message ID:
00832083
Views:
16
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform