473,382 Members | 1,442 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

ListView Select a line

I don't know how to select a line in a LISTVIEW control. In VB6 it looked
like

lv.ListItems(i).Checked = True, if I remember, but I don't find the write
way in VB.NET.

RR Thanks
Nov 20 '05 #1
3 6050
To select the i-th item, you can use code such as

ctlListView.Items(i).Selected = True

sincerely,
--
Sebastian Zaklada
Skilled Software
http://www.skilledsoftware.com
************************************
SQL Source Control 2003 - for
SQL Server Source Safe integration
and custom databases documentation
Nov 20 '05 #2
"Roger Renaud" <ro**********@videotron.ca> schrieb
I don't know how to select a line in a LISTVIEW control.
checked = true checks an item, it doesn't select it.
In VB6 it
looked like

lv.ListItems(i).Checked = True, if I remember, but I don't find the
write way in VB.NET.

lv.ListItems.Items(i).Checked = True
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3
* "Roger Renaud" <ro**********@videotron.ca> scripsit:
I don't know how to select a line in a LISTVIEW control. In VB6 it looked
like

lv.ListItems(i).Checked = True, if I remember, but I don't find the write
way in VB.NET.


Do you want to check the checkbox of the line or do you want to select
it?

Use 'lv.Items(i).Selected = True' to select the item, set its 'Checked'
property to 'True' in order to check its checkbox.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4

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

Similar topics

1
by: Bob Geltz | last post by:
I am able to populate a ListView with several detail lines (several columns). When finished, I would like to pre-select the first item in the list (before the user interacts with the list). This...
1
by: Bob Geltz | last post by:
I am able to populate a ListView with several detail lines (several columns). When finished, I would like to pre-select the first item in the list (before the user interacts with the list). This...
1
by: The Confessor | last post by:
I currently have a listbox in my program which I populate with data from a random access file as follows: For T = 1 To HighestPointID FileGet(1, Point(T), T) ListBox_Point.Items.Add(T & " Lat:...
3
by: rlg | last post by:
We have C# 2005 multi-threaded app. A background thread is processing data and periodically updating the contents of a ListView. Sometimes, the user clicking on a ListView item will not select...
5
by: Phill W. | last post by:
(VB'2003) What's the correct way to remove multiple, selected items from a ListView control (say, from a ContextMenu)? I ask because I'm getting a very annoying ArgumentOutOfRangeException...
1
by: polocar | last post by:
Hi, I'm using Visual C# 2005 (part of Visual Studio 2005 Professional Edition), and I have the following problem: I populate a ListView object with several items, and at the end of this process I...
6
by: Brandon McCombs | last post by:
Hello, I have a form that contains a listview on the left side and a column of buttons on the right side. Only some of the buttons do I want enabled all the time. The other buttons should be...
2
by: milindsm | last post by:
Hello, I am working on a task in which I have to read line by line from a text file and add it to listview as an item. Since the file is too large (around 10K-15K lines), it was taking hell lot...
4
by: Brian Gaze | last post by:
I have created a ListView control and have bound this to a datasource. Within the ItemTemplate of the ListView I have added another ListViewControl which is databound in the code behind. The idea...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.