473,513 Members | 2,339 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3100
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
6298
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
1415
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
2172
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
3403
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
1398
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
1079
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
8262
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
1902
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
29222
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
1432
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
7267
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
7175
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
7391
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
7553
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
5697
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
5100
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
3247
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
3235
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
809
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.