Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Coordinate's in the mouse up event
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00495285
Message ID:
00495315
Vues:
6
>I am using the mouse up event in a shape to resize two grids (one on yhe top of the grid and one on the bottom). When the user clicks and drags the shape the grids will follow in whichever direction and resize as needed to stay within the container they reside in. However the nYcoord is not always accurate to where the mouse up is fired. Is there a conflict with the coordinate's in the container as compared to the form. Or might there be another method to do this someone wants to share?



Here we go again, color-coded this time! :)

In my application, everything is done in the MouseMove event of the object. It has the advantage (perhaps inconvenient on slow PCs) to take action while you are dragging the object. The object here is a container, probably because we simply thought about it first instead of the shape. Here's the code, slightly modified to take the junk out; we have 6 or 7 controls that resize or move, but I've just left 2: grdDT is the grid above and grdDTOuvert is the grid below.
LPARAMETERS nButton, nShift, nXCoord, nYCoord
IF nButton = 1    && Only if the left-mouse button is depressed (dragging)
    && Check to fit within a minimum and maximum range
    IF (nYCoord ThisForm.Height - 95) AND nYCoord > ThisForm.grdDT.Top+60
        && Move the container
        THIS.Top = nYCoord

        && Resize the top control
        ThisForm.grdDt.Height = THIS.Top - THISFORM.grdDt.Top

        && Reposition the bottom control
        ThisForm.grdDtOuvert.Top = This.Top + This.Height

        && Resize the bottom control
        ThisForm.grdDtOuvert.Height = ThisForm.Height - This.Top - ;
            This.Height - 5
    ENDIF
ENDIF
Sylvain Demers
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform