On Oct 30, 2004, at 1:41 PM, David Harris wrote:
On Oct 30, 2004, at 11:09 AM, CV wrote:
Now I think I see what you're after. :) You want to highlight some
additional existing rows beyond a block of currently selected rows?
In this case, the current ListIndex holds the row number of the first
of the currently selected rows. So you would do something like:
dim i as integer
dim NumNewSelections as integer // the number of additional rows
to highlight
dim LastRowToSelect as integer
NumNewSelections = 3 //for example, to highlight 3 rows beyond
existing selections
LastRowToSelect = ListBox1.ListIndex + ListBox1.SelCount +
NumNewSelections - 1
For i = ListBox1.ListIndex to LastRowToSelect
ListBox1.Selected(i) = true
Next
HTH,
Jack
Thank you, Jack. But as I mentioned I have been trying to use the
Selected(i) = True approach and it keeps clearing the previous
selection, e.g. using your example it doesn't "grow" the selection, it
just keeps moving down the list and selecting a single row. I'm
starting to think that I'm doing something in code that is
inadvertently clearing the previous selection each time.
Right. Run my example code in a new project and you'll see that it does
add to the selections as intended.
Jack
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>
|