Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid method - GridHitTest
Message
De
02/08/2001 12:28:00
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
02/08/2001 11:58:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00538901
Message ID:
00538929
Vues:
14
>I am using a grid to display fields of a table.
>I want to give the user a multiple-line selection tool with teh mouse.
>The user clicks on lets say first row of the grid and releases the mouse over the 10th row. at this point I want to selected lines between 1 and 10.
>By select I mean to mark a field in the table as selected.
>
>I tried to use MouseUp Event of the text object in the column and to use GridHittest to get the relative row and relative column where the user released the mouse, but I always get 0 for these relative positions....But even if it's going to work I am not sure how I am going to find the positions in the source table....
>
>Do you have any suggestions?
>
>Thanks,
>Vali

Vali,
GridHitTest works. How do you code it ? MouseDown object (typically a control in grid.column) gets MouseUp also. ie :
*mdown
LPARAMETERS nButton, nShift, nXCoord, nYCoord
store 0 to nWhere, nRelrow, nRelCol
with This.parent.parent
 .GridHittest(nXCoord, nYCoord, @nWhere, @nRelRow, @nRelCol)
 .tag = transform(nWhere)+transform(nRelRow)+transform(nRelCol)
endwith
*mup
LPARAMETERS nButton, nShift, nXCoord, nYCoord
store 0 to nWhere, nRelrow, nRelCol
with This.parent.parent
 .GridHittest(nXCoord, nYCoord, @nWhere, @nRelRow, @nRelCol)
 .tag = .tag+chr(13)+transform(nWhere)+transform(nRelRow)+transform(nRelCol)
 messagebox(.Tag)
endwith
You could easily find out start and end rows with a little math. However you should control scrolling too.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform