Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Drag Drop - Resize
Message
From
19/02/2004 13:15:40
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00878808
Message ID:
00878833
Views:
19
This code adds a container to VFP screen. You can resize it by dragging pressed mouse:
_Screen.AddObject("ResizeContainer", "ResizeContainer")
_Screen.ResizeContainer.Visible = .T.

DEFINE CLASS ResizeContainer AS Container 
  oldX = 0
  oldY = 0
  Resizing = .F.

  PROCEDURE MouseDown
    LPARAMETERS nButton, nShift, nXCoord, nYCoord
    
    This.oldX = nXCoord
    This.oldY = nYCoord
    This.Resizing = .T.
  ENDPROC 
  
  PROCEDURE MouseMove
    LPARAMETERS nButton, nShift, nXCoord, nYCoord
    
    IF NOT This.Resizing THEN 
      RETURN
    ENDIF 
    
    LOCAL nWidth, nHeight
    nWidth = This.Width + nXCoord - This.oldX 
    nHeight = This.Height + nYCoord - This.oldY 
    
    IF nWidth > 0 AND nHeight > 0 THEN 
      This.Move(This.Left, This.Top, nWidth, nHeight)
    ENDIF 
    
    This.oldX = nXCoord
    This.oldY = nYCoord
  ENDPROC 
  
  PROCEDURE MouseUp
    LPARAMETERS nButton, nShift, nXCoord, nYCoord
    
    This.Resizing = .F.
ENDDEFINE 
/A new technology turns into completely outdated stuff before you have a time to read "Getting Started..." section.
/If there are some "system programmers" then others are unsystematic.
Previous
Reply
Map
View

Click here to load this message in the networking platform