Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid - Multiple Selects
Message
From
12/05/1998 14:20:51
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00098532
Message ID:
00098821
Views:
31
>>>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
Hi Richard,
Me either didn't see any need for lLastSelected but I thought at start it would be needed. Futher there is no need for lSelected too. Deleted() works good. Today I played with it more and wrote somewhat similar to yours. I'll pass it to files section when fully finished. Currently trying to add per column incremental search capability + headers from dbc.
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform