Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid - Multiple Selects
Message
 
To
11/05/1998 13:47:14
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00098532
Message ID:
00098663
Views:
26
>>I am interested in making a grid act like a list box control. I want multiple fields in the grid as you can do in the list box, but I want the look and feel of the grid. Has anyone succedded in making a grid control like a list box where you select multiple rows and the color of the selected row(s) changes? I know with the grid's dynamic color propertly I can change the row color. How would I capture a mouse click and know which row I am on to change to color?
>Hello,
>This is not finished yet but you could use it as a starter :
clear all
<snip>

Thanks, that worked great!

I put the following code in for the shift and control keys:

* Left mouse button pressed
if nButton = 1
nodefault
do case
case nShift = 1 && SHIFT Pressed
nCurrec = recno()
locate for lSelected
nskipdirection = 1
if found()
if recno() > nCurrec
nskipdirection = -1
endif
else
go top
endif
do while recno() != nCurrec
replace lSelected with .t.
skip nskipdirection
enddo
go nCurrec
replace lSelected with .t.
case nShift = 2 && CTRL pressed
if lSelected
replace lSelected with .f.
else
replace lSelected with .t.
endif
otherwise && Just the mouse button was pressed
if lSelected
nCurrec = recno()
replace all lSelected with .f.
go nCurrec
replace lSelected with .f.
else
nCurrec = recno()
replace all lSelected with .f.
go nCurrec
replace lSelected with .t.
endif
endcase
endif

I did not see any need for the lLastSelected field.

Richard
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform