Home All Groups Group Topic Archive Search About
Author
2 Mar 2005 4:24 PM
Darin
I have a listview box in detail view with 100+ items. I can select the
50th item by lstdetail.items(49).selected=true. But, when I do that the
item is selected, but the listview box hasn't scrolled down to where
that line item is.

How do I get the listview box to scroll down to the selected items.

Darin

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Author
2 Mar 2005 4:37 PM
Kerry Moorman
Darin,

The listview control has an EnsureVisible method that should do what you need.

Kerry Moorman

Show quoteHide quote
"Darin" wrote:

> I have a listview box in detail view with 100+ items. I can select the
> 50th item by lstdetail.items(49).selected=true. But, when I do that the
> item is selected, but the listview box hasn't scrolled down to where
> that line item is.
>
> How do I get the listview box to scroll down to the selected items.
>
> Darin
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
>
Author
2 Mar 2005 5:31 PM
Darin
THanks - that worked great.

Darin

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Author
25 Mar 2005 7:31 PM
Darin
In addition to this, when the 50th element is selected, that is fine,
but the first element still has a box around it. So, if I select the
50th programmatically, then, when running the program, hit the down
arrow, it moves from element 1 to element 2, even though 50 was
selected.

I need to somehow completely un-select the first element.

My listview has the following properties:

Me.lstCode.FullRowSelect = True
Me.lstCode.Location = New System.Drawing.Point(8, 80)
Me.lstCode.MultiSelect = False
Me.lstCode.Name = "lstCode"
Me.lstCode.Size = New System.Drawing.Size(744, 208)
Me.lstCode.TabIndex = 10
Me.lstCode.View = System.Windows.Forms.View.Details

Darin

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!