473,508 Members | 2,202 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

List View question

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!
Nov 21 '05 #1
5 1320
Me.lsvListView.SelectedItems(0).EnsureVisible

"Darin" <darin_nospam@nospamever> schreef in bericht
news:uV*************@TK2MSFTNGP15.phx.gbl...
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!

Nov 21 '05 #2
Darin,

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

Kerry Moorman

"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!

Nov 21 '05 #3
"Darin" <darin_nospam@nospamever> schrieb:
How do I get the listview box to scroll down to the selected items.


Call the item's 'EnsureVisible' method or the 'EnsureVisible' method of the
listview control.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #4
THanks - that worked great.

Darin

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 21 '05 #5
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!
Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
1858
by: Guy Hocking | last post by:
Hi there, I am having a few problems compiling a list box that is conditional on what is selected in another list box. What i need is a List box (lstArea) that displays one thing when the List...
5
3608
by: Xah Lee | last post by:
suppose i'm going to have a data structure like this: , , , , .... ] should i use (width,height) or ?
19
13543
by: RAJASEKHAR KONDABALA | last post by:
Hi, Does anybody know what the fastest way is to "search for a value in a singly-linked list from its tail" as oposed to its head? I am talking about a non-circular singly-linked list, i.e.,...
5
2274
by: Praveen R | last post by:
Hi ! I am using a List view control to populate data onto. On the click event of the list view control, i need to find out whether the area clicked has any information of has no information. I...
0
3214
by: Brian Henry | last post by:
Here is another virtual mode example for the .NET 2.0 framework while working with the list view. Since you can not access the items collection of the list view you need to do sorting another...
90
10701
by: Christoph Zwerschke | last post by:
Ok, the answer is easy: For historical reasons - built-in sets exist only since Python 2.4. Anyway, I was thinking about whether it would be possible and desirable to change the old behavior in...
15
25718
by: Andrew Brampton | last post by:
Hi, This may sound a odd question, but I wanted to know how you return a list of data from a function. These are some of the ways I know how, and I was wondering which method you normally use....
2
1704
by: Kaur | last post by:
Hi, I have a form Form1 that displays surveys. This form has a subform1 which displays questions related to a particular survey. This subform has a subsubform which displays subquestions for a...
0
1139
by: anna_parkins7 | last post by:
Hi Quick question, that will point me in the right direction. I have 2 user controls on a page, both called List.ascx but obviously in 2 different namespaces and 2 different tags.. however I get...
1
1487
by: Jeff Williams | last post by:
With a list view is it possible and if so how to turn off the search function. What I mean is if you are in a list view and start typing it will search the first column to match or close match a...
0
7331
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7501
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5633
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5056
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4713
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3204
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1564
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
768
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.