[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

how to select Subitem in Listview

Posted on 2004-11-22
3
Medium Priority
?
2,171 Views
Last Modified: 2012-06-27
Is it possible to highlight only the subitem selected when clicked in a listview and return its value. How?
0
Comment
Question by:rdwillett
  • 2
3 Comments
 
LVL 12

Expert Comment

by:jkaios
ID: 12652509
'Let's say that your ListView has 4 columns and two rows of data
 'and you select the second record by clicking on it. After that
 'you want to pull out the value from one of the selected columns/rows.
 
 'Columns:   First   Last     Country     Age
 '                 -----   -----    ---------     ----
 'Row1:       John   Smith   Australia   31
 'Row2:       David  Brown  USA         19
 
 'show the value from each column for the selected item
 
 With ListView1.SelectedItem
   Debug.Print .Text                 '1st column value - David
   Debug.Print .SubItems(1)      '2nd column value - Brown
   Debug.Print .SubItems(2)      '3rd column value - USA
   Debug.Print .SubItems(3)      '4th column value - 19
 End With
0
 
LVL 14

Accepted Solution

by:
Shiju Sasidharan earned 480 total points
ID: 12653055
hi jkaios

try this

>>Detecting ListView SubItem Clicks in Normal And FullRowSelect Mode

http://vbnet.mvps.org/index.html?code/comctl/lvhittest.htm


;-)
Shiju
0
 
LVL 14

Expert Comment

by:Shiju Sasidharan
ID: 12671714
hi rdwillett
 i am gald to know that i was helpful
 Thanks
;-)
Shiju
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses
Course of the Month19 days, 2 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question