Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 9th, 2004, 05:19 AM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default listview control

Does the Listview control have a property that tells you which item was selected?

For reasons too lengthy to go into, I want to make a note of the item a user has selected in a Listview control, clear that Listview control, repopulate it and highlight the item originally selected.

I've seen several properties which seem to do what I want but they all require you to specify an index number. Since I don't know what item a user may click on, I don't know what that index number will be.

Any pointers appreciated.

Thanks.

Reply With Quote
  #2 (permalink)  
Old March 9th, 2004, 07:29 AM
Authorized User
 
Join Date: Aug 2003
Location: , , Belgium.
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How about

For i = 0 To lstList.ListCount - 1

†††If lstList.Selected(i) = True Then

   ††'your actions here

†††end if

Next


If you just have a listview where you can only select one item you can also use:

lstList.listindex

This returns the index of the selected item.

Greetz

Tom.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with ListView Control in C# jiggsroger C# 2005 7 April 7th, 2008 04:25 AM
About Listview control yuetqu BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 1 August 15th, 2006 04:56 AM
Refreshing a ListView control osemollie Pro VB 6 1 July 26th, 2006 10:00 AM
ListView Control JelfMaria VB How-To 4 May 5th, 2005 12:39 AM
ListView Control jlr27613 C++ Programming 1 September 14th, 2004 12:58 PM



All times are GMT -4. The time now is 07:04 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.