473,748 Members | 2,595 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 3117
here's how its done:

private void lv_DoubleClick( object sender, System.EventArg s e)
{
if(lv.SelectedI tems.Count > 0)
{
lv.SelectedItem s[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**********@y ahoo.com> wrote in message
news:e8******** *****@tk2msftng p13.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.EventArg s e)
{
if(lv.SelectedI tems.Count > 0)
{
lv.SelectedItem s[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**********@y ahoo.com> wrote in message
news:e8******** *****@tk2msftng p13.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
6438
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 describe if applied to a sequence of length items. It returns a tuple of three integers; respectively these are the /start/ and /stop/ indices and the /step/ or stride length of the slice. Missing or out-of-bounds indices are handled in a manner...
2
1431
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 (from the Server Explorer to the form) by dragging the table in question to the form and then generating the dataset. In a procedure I add records to the problem table based on values in other datagrids in the following way:
8
2189
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 dealer near you". Here is one I found: http://www.shakespeare-antennas.com/content/dealersearch.asp But I do not want to have it on the web, I want to create it on access. I think will need at least two tables:
4
3434
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, something like {1.1,1.2,1.3,1.4,...} the compare function will be int compare (const void * a, const void * b) {
1
1409
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, the two listboxes have the same number of items, and are linked and show the same portion to the screen. I have been having problems with a listbox in which we can drag&drop items to different indexes, at the same time as being able to...
5
1088
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. Thanks
5
8275
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
1933
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" collection and it doesn't seem any more useful... only allows you to find out the name of each report.
19
29255
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
1456
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
9541
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9370
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9321
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9247
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8242
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4602
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3312
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 we have to send another system
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.