473,406 Members | 2,713 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,406 software developers and data experts.

Find item I double-clicked in ListView and read contents

Is there a way I can find out which item I double-clicked inside a listview?
And what about with subitems? And once I get an item number, can I use it to
read the item and subitem contents?
And if I click on one item, what do I need to do in order for me to
highlight that item I clicked in the following X items?
Since I'll be displaying addressses in the listbox, I'd like to be able to
highlight the whole address when the user clicks on the name.

Thank you again,
Angel
Nov 15 '05 #1
2 3095
here's how its done:

private void lv_DoubleClick(object sender, System.EventArgs e)
{
if(lv.SelectedItems.Count > 0)
{
lv.SelectedItems[0].SubItems[4].Text = "testing";
}
}

also, use the FullRowSelect property on the listview (I'm pretty sure htats
what you're looking for)

Chris

"Angel Monson" <an**********@yahoo.com> wrote in message
news:e8*************@tk2msftngp13.phx.gbl...
Is there a way I can find out which item I double-clicked inside a listview? And what about with subitems? And once I get an item number, can I use it to read the item and subitem contents?
And if I click on one item, what do I need to do in order for me to
highlight that item I clicked in the following X items?
Since I'll be displaying addressses in the listbox, I'd like to be able to
highlight the whole address when the user clicks on the name.

Thank you again,
Angel

Nov 15 '05 #2
here's how its done:

private void lv_DoubleClick(object sender, System.EventArgs e)
{
if(lv.SelectedItems.Count > 0)
{
lv.SelectedItems[0].SubItems[4].Text = "testing";
}
}

also, use the FullRowSelect property on the listview (I'm pretty sure htats
what you're looking for)

Chris

"Angel Monson" <an**********@yahoo.com> wrote in message
news:e8*************@tk2msftngp13.phx.gbl...
Is there a way I can find out which item I double-clicked inside a listview? And what about with subitems? And once I get an item number, can I use it to read the item and subitem contents?
And if I click on one item, what do I need to do in order for me to
highlight that item I clicked in the following X items?
Since I'll be displaying addressses in the listbox, I'd like to be able to
highlight the whole address when the user clicks on the name.

Thank you again,
Angel

Nov 15 '05 #3

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

Similar topics

108
by: Bryan Olson | last post by:
The Python slice type has one method 'indices', and reportedly: This method takes a single integer argument /length/ and computes information about the extended slice that the slice object would...
2
by: PaulNaude | last post by:
VB.NET 2003 I am battling with a specific procedure that does not allow me to update my data adapter due to an apparent syntax error. I created the data adapter usign the drag and drop method...
8
by: Joe | last post by:
I need an Access application that can search dealers from my dealer list, in a 30 miles distance from the user. You may see many applications like this on the web if you search under "find a...
4
by: Davy | last post by:
For example, I have a vector: double vector={1.11,2.38,4,53,17.14...,89.12,91.34} And if the Key I want is 5.2, the nearest item will be 4,53. I found that if the STEP of the vector is constant,...
1
by: Zyrthofar Blackcloak | last post by:
Hi everyone I have a listbox with more items in it than is printed on screen. I need the index number of the first shown item to move another listbox to the same position... Explained differently,...
5
by: Agnes | last post by:
Can combo box return more that 1 item ?? for my currency combo box, short_code, descripiton, currency rate. as user choose the description, I need to get both short_code & currency rate result. ...
5
by: Joerg Battermann | last post by:
Hello there, I have a custom type defined via Public Class Requirement Public IDNumber As Integer Public Name As String Public Description As String Public VersionPlanAttributes As New _
28
by: ryanhokanson | last post by:
I was just trying to get a list of all my reports along with their widths. I can't use the "Reports" collection because it only works on open reports. So I tried looking into the "AllReports"...
19
by: Eugeny Myunster | last post by:
I know, only simple one: #include <stdio.h> int main() { int min=0,max=0,i,arr; for(i=0;i<12;i++) arr=rand()%31-10; for(i=0;i<12;i++)
1
by: qwert7465 | last post by:
here is my code. i am only getting one error: // Final Project #include <iostream.h> #include <iomanip.h> void checkout(); void start_or_startover();
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
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...

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.